private void Start()
    {
        Strategy = CreateStrategy(CreateRocketController());
        Strategy.StartLevel();

        Hud = (GameHud)HudBase.Instance;
        Hud.OnPauseOpened += Pause;
        Hud.OnPauseClosed += Resume;
    }
Beispiel #2
0
        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.");
        }
Beispiel #3
0
        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.");
        }
Beispiel #4
0
 public MiniGameConfig(string windowName, PlayStrategy strategy, List <Npc> npcs)
 {
     WindowName = windowName;
     Npcs       = npcs;
     Strategy   = strategy;
 }
Beispiel #5
0
 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());
 }
Beispiel #6
0
 public PlayerViewModel(bool isAIPlayer, PlayStrategy playStrategy)
     : this(isAIPlayer)
 {
     PlayStrategy = playStrategy;
 }
Beispiel #7
0
 public Player(bool isAIPlayer, bool isSilent, PlayStrategy playStrategy) : this(isAIPlayer, isSilent)
 {
     PlayStrategy = playStrategy;
 }