Ejemplo n.º 1
0
        private void ParseTag(string val, ILogParserHelper parseHelper)
        {
            switch (Action)
            {
            case CatanAction.ChangedPlayer:
                Tag = new LogChangePlayer(val);
                break;

            case CatanAction.AssignedBaron:
            case CatanAction.PlayedKnight:
            case CatanAction.AssignedPirateShip:
                Tag = new LogBaronOrPirate(val, parseHelper);
                break;

            case CatanAction.UpdatedRoadState:
                Tag = new LogRoadUpdate(val, parseHelper);
                break;

            case CatanAction.UpdateBuildingState:
                Tag = new LogBuildingUpdate(val, parseHelper);
                break;

            case CatanAction.AddPlayer:
                Tag = Enum.Parse(typeof(PlayerPosition), val);
                break;

            case CatanAction.AssignHarbors:
            case CatanAction.AssignRandomTiles:
            case CatanAction.RandomizeTiles:
                Tag = LogList <int> .CreateAndParse(val);

                break;

            case CatanAction.ChangedState:
                Tag = new LogStateTranstion(val);
                break;

            case CatanAction.CardsLost:
                Tag = new LogCardsLost(val);
                break;

            case CatanAction.SetFirstPlayer:
                Tag = new LogSetFirstPlayer(val);
                break;

            case CatanAction.RoadTrackingChanged:
                Tag = new LogRoadTrackingChanged(val);
                break;

            case CatanAction.ChangedPlayerProperty:
                Tag = new LogPropertyChanged(val);
                break;

            case CatanAction.AddResourceCount:
                Tag = new LogResourceCount(val);
                break;

            default:
                break;
            }
        }