Ejemplo n.º 1
0
        private MapGenerationParams(XElement element)
        {
            SerializableProperties = SerializableProperty.DeserializeProperties(this, element);

            foreach (XElement subElement in element.Elements())
            {
                switch (subElement.Name.ToString().ToLowerInvariant())
                {
#if CLIENT
                case "connectionsprite":
                    ConnectionSprite = new Sprite(subElement);
                    break;

                case "passedconnectionsprite":
                    PassedConnectionSprite = new Sprite(subElement);
                    break;

                case "maptile":
                    string biome = subElement.GetAttributeString("biome", "");
                    if (!mapTiles.ContainsKey(biome))
                    {
                        mapTiles[biome] = new List <Sprite>();
                    }
                    mapTiles[biome].Add(new Sprite(subElement));
                    break;

                case "fogofwarsprite":
                    FogOfWarSprite = new Sprite(subElement);
                    break;

                case "locationindicator":
                case "currentlocationindicator":
                    CurrentLocationIndicator = new Sprite(subElement);
                    break;

                case "selectedlocationindicator":
                    SelectedLocationIndicator = new Sprite(subElement);
                    break;

                case "decorativegraphsprite":
                    DecorativeGraphSprite = new SpriteSheet(subElement);
                    break;

                case "missionicon":
                    MissionIcon = new Sprite(subElement);
                    break;

                case "typechangeicon":
                    TypeChangeIcon = new Sprite(subElement);
                    break;
#endif
                case "radiationparams":
                    RadiationParams = new RadiationParams(subElement);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 public Radiation(Map map, RadiationParams radiationParams, XElement?element = null)
 {
     SerializableProperties = SerializableProperty.DeserializeProperties(this, element);
     Map            = map;
     Params         = radiationParams;
     radiationTimer = Params.RadiationDamageDelay;
     if (element == null)
     {
         Amount = Params.StartingRadiation;
     }
 }