Beispiel #1
0
        private void Reset_Button_Clicked(object sender, RoutedEventArgs e)
        {
            if (StageChoose.SelectedValue != null)
            {
                PathText.Text = "Current Stage: " + StageChoose.SelectedValue.ToString();
            }

            Info = StartInfo.Clone();
            this.RefreshGrid();
        }
Beispiel #2
0
        /// <summary>
        /// User choose a new stage.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Stage_Changed(object sender, RoutedEventArgs e)
        {
            var selectedStage = int.Parse(StageChoose.SelectedValue.ToString());
            var pack          = GetBoardInfo(selectedStage).Result;

            Engine                   = pack.Engine;
            Info                     = pack.Info;
            StartInfo                = Info.Clone();
            PathText.Text            = "Current Stage: " + selectedStage.ToString();
            AnswerPath               = null;
            ShowPathButton.IsEnabled = false;
            this.InitializeGrid();
            this.RefreshGrid();
        }
Beispiel #3
0
        /// <summary>
        /// checked.
        /// </summary>
        public MainPage()
        {
            // layout component initialize
            this.InitializeComponent();
            PathText.Text = "Welcome.";

            // other properties initialize
            this.InitializeMaps();

            var pack = GetBoardInfo(1).Result;

            Engine    = pack.Engine;
            Info      = pack.Info;
            StartInfo = Info.Clone();

            AI = new AIPlayer();

            // grid initialize and paint
            this.InitializeGrid();
            this.RefreshGrid();
        }
Beispiel #4
0
 public GameState(BoardInfo info)
 {
     this.Info         = (BoardInfo)info.Clone();
     this.DistanceCost = -1;
     this.PathCost     = -1;
 }