Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, how do I translate the following code(s) in UML? void update() { if ( currentState == MAIN_MENU ) { drawMainMenu(); checkMenuButtonClicked(); ... } else

Hi, how do I translate the following code(s) in UML?

void update() { if( currentState == MAIN_MENU ) {

drawMainMenu(); checkMenuButtonClicked();

...

} else if( currentState == IN_GAME ) {

}

drawCharacters();

drawInterface();

getCurrentMove();

}

}

---------------------------------------------------------------------------

abstract class State { protected Game game; abstract void handleUpdate(); State(Game g) { game = g; }

}

class CharSelect extends State {

void handleUpdate() {

if selectedChar()

return new InGame(

 ..., selectedChar()); 

}

}

------------------------------------------

class Working {

ProcessState update() {

if( stuffToProcess() )

processStuff();

return new Working();

else

return new Waiting();

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

1. Administrative routines, such as taking attendance

Answered: 1 week ago