Exemplo n.º 1
0
 public void DeserializeByaml(IDictionary <string, object> dictionary)
 {
     Announcement = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["Announce"]);
     Start        = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["Start"]);
     End          = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["End"]);
     Result       = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["Result"]);
 }
Exemplo n.º 2
0
        public void DeserializeByaml(IDictionary <string, object> dictionary)
        {
            // Deserialize the time
            UnlockTime = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["DateTime"]);

            // Get the enum value for the VersusRule
            VersusRule = (VersusRule)EnumUtil.GetEnumValueFromString(typeof(VersusRule), (string)dictionary["Rule"]);
        }
Exemplo n.º 3
0
        public void DeserializeByaml(IDictionary <string, object> dictionary)
        {
            StartDateTime = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["DateTime"]);

            void PopulateStagesSeedDict(string sourceDictKey, Dictionary <VersusRule, RandomizerSeed> targetDict)
            {
                // Get the source dictionary
                Dictionary <string, object> sourceDict = (Dictionary <string, object>)dictionary[sourceDictKey];

                // Get the raw seed dictionary for every mode
                foreach (KeyValuePair <string, object> pair in sourceDict)
                {
                    // Get the VersusRule enum
                    VersusRule VersusRule = (VersusRule)EnumUtil.GetEnumValueFromString(typeof(VersusRule), pair.Key);

                    // Create a new RandomizerSeed instance and deserialize
                    RandomizerSeed randomizerSeed = new RandomizerSeed();
                    randomizerSeed.DeserializeByaml((Dictionary <string, object>)pair.Value);

                    // Add this to the target dictionary
                    targetDict.Add(VersusRule, randomizerSeed);
                }
            }

            // Create the seed dictionaries
            GachiStagesSeed  = new Dictionary <VersusRule, RandomizerSeed>();
            LeagueStagesSeed = new Dictionary <VersusRule, RandomizerSeed>();

            // Populate them
            PopulateStagesSeedDict("GachiRuleStage", GachiStagesSeed);
            PopulateStagesSeedDict("LeagueRuleStage", LeagueStagesSeed);

            void PopulateRuleWeightDict(string sourceDictKey, Dictionary <VersusRule, int> targetDict)
            {
                // Get the source dictionary
                Dictionary <string, object> sourceDict = (Dictionary <string, object>)dictionary[sourceDictKey];

                // Get the raw seed dictionary for every mode
                foreach (KeyValuePair <string, object> pair in sourceDict)
                {
                    // Get the VersusRule enum
                    VersusRule VersusRule = (VersusRule)EnumUtil.GetEnumValueFromString(typeof(VersusRule), pair.Key);

                    // Add this to the target dictionary
                    targetDict.Add(VersusRule, (int)pair.Value);
                }
            }

            // Create the weighting dictionaries
            GachiRuleWeight  = new Dictionary <VersusRule, int>();
            LeagueRuleWeight = new Dictionary <VersusRule, int>();

            // Populate them
            PopulateRuleWeightDict("GachiRuleWeight", GachiRuleWeight);
            PopulateRuleWeightDict("LeagueRuleWeight", LeagueRuleWeight);
        }
Exemplo n.º 4
0
 public Color GetColor4fAsColor()
 {
     return(Color.FromArgb
            (
                Convert.ToInt32(BlitzBcatDeserializationUtil.GetValueAsFloat(Color4f[3]) * 255.0f),
                Convert.ToInt32(BlitzBcatDeserializationUtil.GetValueAsFloat(Color4f[0]) * 255.0f),
                Convert.ToInt32(BlitzBcatDeserializationUtil.GetValueAsFloat(Color4f[1]) * 255.0f),
                Convert.ToInt32(BlitzBcatDeserializationUtil.GetValueAsFloat(Color4f[2]) * 255.0f)
            ));
 }
Exemplo n.º 5
0
 public void DeserializeByaml(IDictionary <string, object> dictionary)
 {
     DateTime = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["DateTime"]);
 }
Exemplo n.º 6
0
 public void DeserializeByaml(IDictionary <string, object> dictionary)
 {
     StartDateTime = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["DateTime"]);
     GearType      = (GearType)EnumUtil.GetEnumValueFromString(typeof(GearType), (string)dictionary["GearKind"]);
 }
Exemplo n.º 7
0
 public void DeserializeByaml(IDictionary <string, object> dictionary)
 {
     Begin = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["BeginTime"]);
     End   = BlitzBcatDeserializationUtil.DeserializeDateTime(dictionary["EndTime"]);
 }