Example #1
0
    private void DeserialiseGameValueType(GameValueModifer modifer)
    {
        GameValueType type;

        try
        {
            type = (GameValueType)Enum.Parse(typeof(GameValueType), modifer.serializedtype);
        }
        catch
        {
            type = GameValueType.CropProduction;
        }
        modifer.propertyType   = type;
        modifer.serializedtype = type.ToString();
    }
Example #2
0
    public GameEvent(GameEvent gEvent)
    {
        name = gEvent.name;
        ID   = gEvent.ID;
        useSubEventMessages        = gEvent.useSubEventMessages;
        scenario                   = gEvent.scenario;
        oddsOfOccuring             = new DynamicValue(gEvent.oddsOfOccuring);
        StartingCondition          = new EventConditionGroup(gEvent.StartingCondition);
        ContinualCondition         = new EventConditionGroup(gEvent.ContinualCondition);
        FamilyCondition            = new FamilyConditionGroup(gEvent.FamilyCondition);
        MaxOccurencePerPlaythrough = new DynamicValue(gEvent.MaxOccurencePerPlaythrough);
        Occurence                  = gEvent.Occurence;
        Duration                   = gEvent.Duration;

        startingMessage = new string[gEvent.startingMessage.Length];
        for (int i = 0; i < startingMessage.Length; i++)
        {
            startingMessage[i] = gEvent.startingMessage[i];
        }

        endingMessage = new string[gEvent.endingMessage.Length];
        for (int i = 0; i < endingMessage.Length; i++)
        {
            endingMessage[i] = gEvent.endingMessage[i];
        }

        modifers = new GameValueModifer[gEvent.modifers.Length];
        for (int i = 0; i < modifers.Length; i++)
        {
            modifers[i] = new GameValueModifer(gEvent.modifers[i]);
        }

        subEvents = new SubEvent[gEvent.subEvents.Length];
        for (int i = 0; i < subEvents.Length; i++)
        {
            subEvents[i] = new SubEvent(gEvent.subEvents[i]);
        }
    }