Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="textureCache"></param>
        public BuildingMenuBar(ConcurrentDictionary<string, Texture2D> textureCache)
        {
            this.textureCache = textureCache;
            position = new Vector2(0, 0);

            Texture2D mbB;
            textureCache.TryGetValue("MenuBarEnding", out mbB);
            mbBegin = new Tile(mbB, 120);
            mbEnd = new Tile(mbB, 120);
            mbEnd.Rotate(180);
            Texture2D mbM;
            textureCache.TryGetValue("MenuBar", out mbM);
            mbMiddle = new Tile(mbM, 120);
            buildthings.Add(new Tile(textureCache, 100, "WoodWall"));
            buildthings.Add(new Tile(textureCache, 100, "WoodWallCorner"));
            buildthings.Add(new Tile(textureCache, 100, "Stone"));
            selector = new Tile(textureCache, 100, "BuildCursor");
        }
Пример #2
0
 /// <summary>
 /// Returns a new object with equal attributes
 /// </summary>
 /// <returns></returns>
 public object Clone()
 {
     Tile res = new Tile(texture, xSize);
     res.Rotate(rotation);
     res.SetPosition(xPosition, yPosition);
     return res;
 }