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(); }
/// <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(); }
/// <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(); }
public GameState(BoardInfo info) { this.Info = (BoardInfo)info.Clone(); this.DistanceCost = -1; this.PathCost = -1; }