Ejemplo n.º 1
0
        public FightMapStatus CreateFightMapStatus(int regionIndex)
        {
            //IL_0009: Unknown result type (might be due to invalid IL or missing references)
            //IL_000e: Unknown result type (might be due to invalid IL or missing references)
            //IL_000f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            //IL_0015: Unknown result type (might be due to invalid IL or missing references)
            //IL_0016: Unknown result type (might be due to invalid IL or missing references)
            //IL_0017: Unknown result type (might be due to invalid IL or missing references)
            //IL_001c: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00f1: Unknown result type (might be due to invalid IL or missing references)
            FightMapRegionDefinition obj = m_regions[regionIndex];
            Vector2Int sizeMin           = obj.sizeMin;
            Vector2Int sizeMax           = obj.sizeMax;
            Vector2Int val  = sizeMax - sizeMin;
            int        num  = val.get_x() * val.get_y();
            int        num2 = m_sizeMax.get_x() - m_sizeMin.get_x();
            int        num3 = m_sizeMin.get_y() * num2 + m_sizeMin.get_x();
            int        num4 = sizeMax.get_x() - sizeMin.get_x();
            int        num5 = sizeMin.get_y() * num4 + sizeMin.get_x();

            FightCellState[] cellStates = m_cellStates;
            FightCellState[] array      = new FightCellState[num];
            for (int i = sizeMin.get_y(); i < sizeMax.get_y(); i++)
            {
                for (int j = sizeMin.get_x(); j < sizeMax.get_x(); j++)
                {
                    int num6 = i * num2 + j - num3;
                    int num7 = i * num4 + j - num5;
                    array[num7] = cellStates[num6];
                }
            }
            return(new FightMapStatus(array, sizeMin, sizeMax));
        }
Ejemplo n.º 2
0
        public static FightMapRegionDefinition FromJsonToken(JToken token)
        {
            //IL_0001: Unknown result type (might be due to invalid IL or missing references)
            //IL_0007: Invalid comparison between Unknown and I4
            //IL_000f: Unknown result type (might be due to invalid IL or missing references)
            if ((int)token.get_Type() != 1)
            {
                Debug.LogWarning((object)("Malformed token : type Object expected, but " + token.get_Type() + " found"));
                return(null);
            }
            JObject jsonObject = Extensions.Value <JObject>((IEnumerable <JToken>)token);
            FightMapRegionDefinition fightMapRegionDefinition = new FightMapRegionDefinition();

            fightMapRegionDefinition.PopulateFromJson(jsonObject);
            return(fightMapRegionDefinition);
        }
Ejemplo n.º 3
0
        public static FightMapRegionDefinition FromJsonProperty(JObject jsonObject, string propertyName, FightMapRegionDefinition defaultValue = null)
        {
            //IL_0011: Unknown result type (might be due to invalid IL or missing references)
            //IL_0018: Invalid comparison between Unknown and I4
            JProperty val = jsonObject.Property(propertyName);

            if (val == null || (int)val.get_Value().get_Type() == 10)
            {
                return(defaultValue);
            }
            return(FromJsonToken(val.get_Value()));
        }