Exemplo n.º 1
0
        public VarHeightBuildingContribution(AbstractExStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main)
        {
            _price = master.unitPrice;
            if (opposite)
            {
                size = new SIZE(master.size.y, master.size.x);
            }
            else
            {
                size = master.size;
            }
            _ppa      = _price / Math.Max(1, size.x * size.y);
            minHeight = master.minHeight;
            maxHeight = master.maxHeight;


            tops    = loadSpriteSets(pic.SelectNodes("top"));
            bottoms = loadSpriteSets(pic.SelectNodes("bottom"));

            XmlElement   m = (XmlElement)XmlUtil.selectSingleNode(pic, "middle");
            XmlAttribute a = m.Attributes["overlay"];

            if (a != null && a.InnerText.Equals("true"))
            {
                overlay = true;
            }
            middle = PluginUtil.getSpriteLoader(m).load2D(m, size, size.x * 8);
        }
        public FixedSizeStructureContribution(AbstractExStructure master, XmlElement pic, XmlElement main, bool opposite) : base(main)
        {
            _price = master.unitPrice;
            int height = master.maxHeight;

            if (opposite)
            {
                size = new Distance(master.size.y, master.size.x, height);
            }
            else
            {
                this.size = new Distance(master.size, height);
            }
            _ppa    = _price / Math.Max(1, size.x * size.y);
            sprites = PluginUtil.getSpriteLoader(pic).load3D(pic, size.x, size.y, height);
        }
 public CommercialStructureContribution(AbstractExStructure master, XmlElement pic, XmlElement main, bool opposite)
     : base(master, pic, main, opposite)
 {
 }