/// <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; }
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); }