Exemplo n.º 1
0
 public void SpawnMobiles(GameState state)
 {
     var mobiles = state.Mobiles;
      var spawnXs = state.Map.InitialSpawnXs.Shuffle().Take(mobiles.Count).ToArray();
      for (var i = 0; i < mobiles.Count; i++) {
     var mobile = mobiles[i];
     var spawnX = spawnXs[i];
     int spawnY;
     if (!state.Map.TryFindTopmostPixel(spawnX, out spawnY)) {
        throw GameExceptions.BadSpawn(state.Map, spawnX);
     }
     state.PushEvent(new SpawnEvent(mobile.Id, spawnX, spawnY, true));
      }
 }
Exemplo n.º 2
0
 public PlayerRoundPhase(GameState state)
 {
     this.state = state;
 }
Exemplo n.º 3
0
 public InitializationPhase(GameState state, GamePhaseManager gamePhaseManager)
 {
     this.state = state;
      this.gamePhaseManager = gamePhaseManager;
 }
Exemplo n.º 4
0
 public MobileInstance PickNextMobile(GameState gameState)
 {
     return gameState.Mobiles.MinBy(mobile => mobile.RoundDelay);
 }
Exemplo n.º 5
0
 public MobileInstance GetMobileById(GameState gameState, int mobileId)
 {
     return gameState.Mobiles.First(mobile => mobile.Id == mobileId);
 }