コード例 #1
0
        /// <summary>
        /// Dispatches the game mode selected event.
        /// </summary>
        /// <param name="gameMode">Game mode.</param>
        private void DispatchGameModeSelectedEvent(Globals.GameModes gameMode)
        {
            EventHandler <BeginGameEventArgs> eventHandler = GameModeSelected;

            if (eventHandler != null)
            {
                eventHandler(this, new BeginGameEventArgs(gameMode));
            }
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RPS.RockPaperScissorsState"/> class.
 /// </summary>
 /// <param name="gameMode">Game mode.</param>
 /// <param name="targetObject">Target object.</param>
 /// <param name="stateData">State data.</param>
 public RockPaperScissorsState(Globals.GameModes gameMode, GameView targetObject, Dictionary <string, object> stateData) : base(targetObject, stateData)
 {
     // Create our model based on game mode
     model = (gameMode == Globals.GameModes.SinglePlayer ? model = new SingleRockPaperScissorsModel() : new MultiRockPaperScissorsModel()) as IRockPaperScissorsModel;
 }
コード例 #3
0
 public BeginGameEventArgs(Globals.GameModes gameMode)
 {
     this.GameMode = gameMode;
 }