From Asgard
Jump to: navigation, search

Data Members

-party1: Party

The Hero Party.

-party2: Party

The Villain Party.

-controller: ConsoleController

A link to the controller. Set by the ConsoleController.

-view: ConsoleView

A link to the view. Set by the ConsoleController.

-currentTime: int

The number of iterations of the gameLoop since the battle began.

-eventTypeList: EventType[]

All the types of events that can be done by Fighters that are enabled to do so.

-monsters: Fighter[]

Monsters loaded from the static XML files.



+isOver(): boolean

Is one of the parties dead?

+nextTurn(): boolean

Executes the next iteration of the game loop: After a pause of some duration, increment the current time of the battle. Then, execute all the events that are available for execution this iteration. Also, calls Status.genIteration(). Returns true if an event was executed.

+executeNextEvent(ct: int, cont: ConsoleController): boolean

Query the two parties to see if there are any events that can be generated this iteration of the game loop. If there are events, execute the event from the party whose fighter has the highest dexterity. Return whether or not the event was executed or not.

+getCurrentTime(): int

+setCurrentTime(ct: int): void

+getParty1(): Party

+getParty2(): Party

+setView(v: ConsoleView): void

Sets the view object link. Used by ConsoleController.

+setController(c: ConsoleView): void

Sets the controller object link. Used by ConsoleController.

+getEventTypeList(): EventType[]

+setEventTypeList(et: EventType[]): void

+getEventType(typeName: string): EventType

Gets an EventType object from the loaded EventType list that is named provided typeName string.

+getMonsters(): Fighter +setMonsters(monsters: Fighter[]): void