Exemplo n.º 1
0
 /// <summary>
 /// Initialises the necessary parts of the Simulation
 /// </summary>
 protected override void Initialize()
 {
     base.Initialize();
     this.IsMouseVisible = true;
     theWorld = null;
     state = new InitialisationState();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sets up the drawer, getting the font and spritebatch from the Display class and initialising the MenuButton
 /// </summary>
 /// <param name="option">The SimulationState that this object is in charge of drawing</param>
 public SingleStringDrawer(SimulationState state)
 {
     this.state = state;
     font = Display.getFont();
     batch = Display.getSpriteBatch();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Restarts and regenerates the world and creatures by returning to the initialisation state
 /// </summary>
 public static void restart()
 {
     state = new InitialisationState();
     currentGeneration = 1;
     currentRoundTime = 0;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Resumes the world updating, and returns to the world state from the menu
 /// </summary>
 public static void resume()
 {
     state = theWorld;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Transitions to the options menu state
 /// </summary>
 public static void options()
 {
     state = new OptionsState();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Calls when the judging state finishes judging, and adds the next set of creatures to the world after it is reset
 /// </summary>
 /// <param name="creatureList">The list of creatures the judging state has created</param>
 public static void judgingDone(List<Creature> creatureList)
 {
     theWorld.reset(creatureList);
     state = theWorld;
     currentRoundTime = 0;
     currentGeneration++;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Transitions to the judging state, getting the necessary input from the world and initialising the judging state
 /// </summary>
 public static void judge()
 {
     WorldState w = theWorld;
     state = new JudgingState(w.getLiveCreatures(), w.getDeadCreatures());
 }
Exemplo n.º 8
0
 /// <summary>
 /// Transitions to the main menu state
 /// </summary>
 public static void goToMenu()
 {
     state = new MainMenuState();
 }
Exemplo n.º 9
0
 /// <summary>
 /// Begins the world state simulation, generating a new world and setting it to the current state
 /// </summary>
 /// <param name="creatureList">The list of creatures to add to the new world</param>
 /// <param name="seed">The seed of the random number generator to add to the world</param>
 public static void begin(List<Creature> creatureList, int seed)
 {
     theWorld = new WorldState(seed, creatureList);
     state = theWorld;
 }