コード例 #1
0
ファイル: Game.cs プロジェクト: vgichar/shah
 /// <summary>
 /// Raises the GoneBack event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnGoneBack(MoveEventArgs e)
 {
     if (GoneBack != null) { GoneBack(this, e); }
 }
コード例 #2
0
ファイル: Game.cs プロジェクト: vgichar/shah
 /// <summary>
 /// Raises the GoneForward event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnGoneForward(MoveEventArgs e)
 {
     if (GoneForward != null) { GoneForward(this, e); }
 }
コード例 #3
0
        void model_GoneBack(object sender, MoveEventArgs e)
        {
            // set the board index
            moveHistoryStringDescriptionList.BoardIndex = e.Index + 1;

            // set the statuses text
            SetStatusesText();
        }
コード例 #4
0
ファイル: Game.cs プロジェクト: vgichar/shah
 /// <summary>
 /// Raises the Moved event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnMoved(MoveEventArgs e)
 {
     if (Moved != null) { Moved(this, e); }
 }
コード例 #5
0
        private void model_Moved(object sender, MoveEventArgs e)
        {
            // if there are more moves in this list than the move index
            // it means that the model moved when the current board index was not the last one
            if (e.Index < moveHistoryStringDescriptionList.Count)
            {
                moveHistoryStringDescriptionList.RemoveRange(e.Index, moveHistoryStringDescriptionList.Count - e.Index);
            }

            // set the rest of the SAN information after the move is made
            tempSAN += Utils.GetSANEnd(model, e.Move);

            // add the move string description to the history
            moveHistoryStringDescriptionList.Add(new MoveStringDescription(tempIndex, tempSAN));

            // set the board index
            moveHistoryStringDescriptionList.BoardIndex = e.Index + 1;

            // set the result
            SetResult();

            // set the statuses text
            SetStatusesText();

            // try to autosave - call the autosave handler delegate
            // if it's not null and if the model is not loading moves
            if (Save != null && !isModelLoadingMoves)
            {
                Save();
            }
        }