Esempio n. 1
0
 /// <summary>
 /// Initialize a GameState to a level as defined by the level model.
 /// </summary>
 /// <param name="stack"></param>
 /// <param name="level"></param>
 public GameState(GameStateStack stack, SharedContent.LevelModel level)
     : this(stack)
 {
     foreach (SharedContent.CreepSpawner spawner in level.SpawnPoints)
     {
         nonInteractives.Add(new Entity(spawner, Resources.res.content));
     }
     gameObjectives.Add(Resources.getPrototype(level.GameObjectiveAsset));
     leveltime = leveltimeleft = level.Duration;
 }
Esempio n. 2
0
        public static GameState Create(GameStateStack stack, SharedContent.LevelModel level, List <Entity> players)
        {
            GameState ret = new GameState(stack, level);

            foreach (Entity player in players)
            {
                ret.addPlayer(player);
            }
            return(ret);
        }