us.asciiroth.client.core
Class Game

java.lang.Object
  extended by us.asciiroth.client.core.Game
All Implemented Interfaces:
HasBoard

public class Game
extends java.lang.Object
implements HasBoard

Central controller for the game.


Method Summary
 void agentMove(Cell agentLoc, Agent agent, Targeting targeting)
           
 void agentMove(Event event, Cell agentLoc, Agent agent, Direction direction)
           
 void changeFonts()
           
 void confirmQuit()
           
 Event createEvent()
          Oh, you can whine about context objects, but the tools in this environment are limited.
 void damage(Cell cell, Agent agent, int delta)
          Do not allow an agent to move due to animation, when we're in the middle of figuring out if their dead or not.
 void defaultForCurrentCell()
          For those using the number pad, it's helpful to use "5" for default actions.
 void deleteGame(java.lang.String name, com.google.gwt.user.client.Command callback)
           
 void die(Cell cell, Agent agent)
           
 void drop(Event event, Cell cell, Item item)
           
 void dropSelectedItem()
           
 void fireWeapon(Direction dir)
           
 void gameOver(java.lang.String url, boolean hasWon)
           
static Game get()
           
 Board getBoard()
           
 int getHeightOfGameScreen()
           
 Player getPlayer()
           
 Profile getProfile()
           
 void getSavedGames(NamesCallback callback)
           
 void init()
           
 boolean isGameInProgress()
           
 boolean isTestGame()
          Is this game a test run from the map editor? If so, many options are disabled to discourage "cheating" in this manner.
 void land()
          After a board is loaded, there's a bunch of work to show the right UI components, and to fire the events for the cell the player has landed on.
 void landWithoutEvents()
          Land the player after a save, without firing events on the cell.
 void loadBoard(Player player, com.google.gwt.user.client.Command command)
           
 void loadGame(java.lang.String name)
           
 void mainMenu()
           
 void move(Direction direction)
           
 void moveSelectedDown()
           
 void moveSelectedUp()
           
 void moveVertical()
           
 void newGame(java.lang.String name, java.lang.String scenarioUrl)
           
 void pickupItem(Cell cell, int index)
           
 void pickupItem(int index)
           
 void promptForScenario(NewGameDialog dialog)
           
 void quitApplication()
           
 void rotateItems()
          Although you can drop or throw things to the point where they are not listed in the menu of ten items, you can then rotate the list to see each item, for the obscure case where you'd want to do that.
 void saveGame(java.lang.String saveUnderName)
           
 void saveGameAndQuit()
           
 void selectDown()
           
 void selectEmptyHanded()
           
 void selectFirstWeapon()
           
 void selectSaveGameName()
           
 void selectUp()
           
 void setToThrowItem()
           
 void shoot(Cell agentLoc, Agent agent, Item ammo, Targeting targeting)
           
 void shoot(Event event, Cell agentLoc, Piece originator, Item ammo, Direction dir)
           
 void teleport(java.lang.String boardID, int x, int y)
           
 void testGame()
           
 void throwItem(Direction direction)
           
 void useSelectedItem()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

agentMove

public void agentMove(Cell agentLoc,
                      Agent agent,
                      Targeting targeting)

agentMove

public void agentMove(Event event,
                      Cell agentLoc,
                      Agent agent,
                      Direction direction)

changeFonts

public void changeFonts()

confirmQuit

public void confirmQuit()

createEvent

public Event createEvent()
Oh, you can whine about context objects, but the tools in this environment are limited.

Returns:
an event object.

damage

public void damage(Cell cell,
                   Agent agent,
                   int delta)
Do not allow an agent to move due to animation, when we're in the middle of figuring out if their dead or not. Or we won't successfully remove the agent from the cell (it'll be in a different cell), and it'll simultaneously die and move away. Rare but annoying. This basically means changeHealth should never be called anywhere but here, how to enforce?

Parameters:
cell -
agent -
delta -

defaultForCurrentCell

public void defaultForCurrentCell()
For those using the number pad, it's helpful to use "5" for default actions. Sometimes though, the action to take is ambiguous. Here, we will pick up an item if it is underfoot, or move vertically if that is possible, otherwise we'll use the currently selected item.


deleteGame

public void deleteGame(java.lang.String name,
                       com.google.gwt.user.client.Command callback)

die

public void die(Cell cell,
                Agent agent)

drop

public void drop(Event event,
                 Cell cell,
                 Item item)

dropSelectedItem

public void dropSelectedItem()

fireWeapon

public void fireWeapon(Direction dir)

gameOver

public void gameOver(java.lang.String url,
                     boolean hasWon)

get

public static Game get()

getBoard

public Board getBoard()
Specified by:
getBoard in interface HasBoard

getHeightOfGameScreen

public int getHeightOfGameScreen()

getPlayer

public Player getPlayer()

getProfile

public Profile getProfile()

getSavedGames

public void getSavedGames(NamesCallback callback)

init

public void init()

isGameInProgress

public boolean isGameInProgress()

isTestGame

public boolean isTestGame()
Is this game a test run from the map editor? If so, many options are disabled to discourage "cheating" in this manner.

Returns:
true if the game was opened from within the map editor.

land

public void land()
After a board is loaded, there's a bunch of work to show the right UI components, and to fire the events for the cell the player has landed on.


landWithoutEvents

public void landWithoutEvents()
Land the player after a save, without firing events on the cell.


loadBoard

public void loadBoard(Player player,
                      com.google.gwt.user.client.Command command)

loadGame

public void loadGame(java.lang.String name)

mainMenu

public void mainMenu()

move

public void move(Direction direction)

moveSelectedDown

public void moveSelectedDown()

moveSelectedUp

public void moveSelectedUp()

moveVertical

public void moveVertical()

newGame

public void newGame(java.lang.String name,
                    java.lang.String scenarioUrl)

pickupItem

public void pickupItem(Cell cell,
                       int index)

pickupItem

public void pickupItem(int index)

promptForScenario

public void promptForScenario(NewGameDialog dialog)

quitApplication

public void quitApplication()

rotateItems

public void rotateItems()
Although you can drop or throw things to the point where they are not listed in the menu of ten items, you can then rotate the list to see each item, for the obscure case where you'd want to do that.


saveGame

public void saveGame(java.lang.String saveUnderName)

saveGameAndQuit

public void saveGameAndQuit()

selectDown

public void selectDown()

selectEmptyHanded

public void selectEmptyHanded()

selectFirstWeapon

public void selectFirstWeapon()

selectSaveGameName

public void selectSaveGameName()

selectUp

public void selectUp()

setToThrowItem

public void setToThrowItem()

shoot

public void shoot(Cell agentLoc,
                  Agent agent,
                  Item ammo,
                  Targeting targeting)

shoot

public void shoot(Event event,
                  Cell agentLoc,
                  Piece originator,
                  Item ammo,
                  Direction dir)

teleport

public void teleport(java.lang.String boardID,
                     int x,
                     int y)

testGame

public void testGame()

throwItem

public void throwItem(Direction direction)

useSelectedItem

public void useSelectedItem()

0.7

© 2009 Alx Dark