public void LoadGame() { RLGame loadedGame = ioService.LoadGame(); this.map = loadedGame.map; this.levelGenerator = loadedGame.levelGenerator; this.messages = loadedGame.messages; this.renderer = loadedGame.renderer; this.ioService = loadedGame.ioService; this.monsters = loadedGame.monsters; this.messages = loadedGame.messages; this.playerActionsService = loadedGame.playerActionsService; this.aiService = loadedGame.aiService; this.hero = loadedGame.hero; this.dice = loadedGame.dice; }
public RLGame(Interfaces.IRLRenderer renderer = null, Interfaces.IRLLevelGenerator levelGenerator = null, IJsonGameIOService jsonService = null, RLMap map = null, List<RLMonster> monsters = null, Stack<Tuple<ConsoleColor, string>> messages = null, RLPlayerActionsService playerActionsService = null, RLAIService aiService = null, RLHero hero = null, RLDice injectedDice = null) { this.renderer = renderer != null ? renderer : new RLRenderer(); this.levelGenerator = levelGenerator != null ? levelGenerator : new RLLevelGenerator(); this.ioService = jsonService != null ? jsonService : new JsonGameIOService(); this.map = map; this.monsters = monsters != null ? monsters : new List<RLMonster>(); this.messages = messages != null ? messages : new Stack<Tuple<ConsoleColor, string>>(); this.playerActionsService = playerActionsService != null ? playerActionsService : new RLPlayerActionsService(); this.dice = injectedDice != null ? injectedDice : new RLDice(); this.aiService = aiService != null ? aiService : new RLAIService(dice); this.hero = hero != null ? hero : this.levelGenerator.GetDefaultHero(); }
public RLAIService(RLDice dice = null) { _dice = dice != null ? dice : new RLDice(); }