private void Start() { Strategy = CreateStrategy(CreateRocketController()); Strategy.StartLevel(); Hud = (GameHud)HudBase.Instance; Hud.OnPauseOpened += Pause; Hud.OnPauseClosed += Resume; }
public override void Start() { ResetBotState(); var config = this.GetGameConfig(); if (config == null) { LogError("Wrong config."); TreeRoot.Stop(); return; } var npcList = config.Npcs; Strategy = config.Strategy; if (npcList == null || npcList.Count == 0) { LogError("Wrong config. Npc isn't defined."); TreeRoot.Stop(); return; } Random r = new Random(); int npcIndexR = r.Next(0, 1000); int npcIndex = npcIndexR % npcList.Count; TargetNpc = npcList[npcIndex]; gameWindow = new SimpleGameWindow(config.WindowName); Navigator.NavigationProvider = new ServiceNavigationProvider(); Navigator.PlayerMover = new SlideMover(); Log("Starting."); }
public override void Start() { FinalizedPath = null; findPathRequested = false; playCount = 0; statistic.Reset(); if (!availableConfigs.ContainsKey(SelectedGame)) { TreeRoot.Stop(); return; } var config = availableConfigs[SelectedGame]; var npcList = config.Npcs; Strategy = config.Strategy; if (npcList == null || npcList.Count == 0) { TreeRoot.Stop(); return; } Random r = new Random(); int npcIndexR = r.Next(0, 1000); int npcIndex = npcIndexR % npcList.Count; TargetNpc = npcList[npcIndex]; gameWindow = new SimpleGameWindow(config.WindowName); Navigator.NavigationProvider = new ServiceNavigationProvider(); Navigator.PlayerMover = new SlideMover(); Log("Starting."); }
public MiniGameConfig(string windowName, PlayStrategy strategy, List <Npc> npcs) { WindowName = windowName; Npcs = npcs; Strategy = strategy; }
private static void AssertNextPosition(PlayStrategy playStrategy, string initialState, IEnumerable<int> expectedPositions) { var boardState = new BoardState(ParseInitialState(initialState)); playStrategy.SetMark(BoardMark.O); int nextPosition = playStrategy.GetNextPosition(boardState); Assert.True(expectedPositions.Any(p => p == nextPosition), nextPosition.ToString()); }
public PlayerViewModel(bool isAIPlayer, PlayStrategy playStrategy) : this(isAIPlayer) { PlayStrategy = playStrategy; }
public Player(bool isAIPlayer, bool isSilent, PlayStrategy playStrategy) : this(isAIPlayer, isSilent) { PlayStrategy = playStrategy; }