Example #1
0
        private static void ProcessActions(int gameID, List <GameAction> actions)
        {
            Game game = ctx.GetGameByID(gameID);

            foreach (GameAction action in actions)
            {
                Console.WriteLine(String.Format("Process Action, type: \"{0}\", game: \"{1}\"", action.ToString(), game.Name));

                switch (action.ActionTypeID)
                {
                case (int)ActionTypes.UserJoined: UserJoined(game, action); break;

                case (int)ActionTypes.UserLeft: UserLeft(game, action); break;

                default: throw new NotSupportedException(String.Format("This action (ID: {0}) is not supported.", action.ActionTypeID));
                }

                Console.WriteLine();
            }
        }