Пример #1
0
        /// <summary>
        /// Create an instance of a building ScreenElement
        /// </summary>
        public Building(Pair <int> position, Pair <int> size, BuildingData data) : base(position.y)
        {
            this.Clickable = true;
            this.Position  = position;
            this.Size      = size;
            this.data      = data;

            this.deleteButton          = new DeleteBuildingButton(this);
            this.deleteButton.Position = new Pair <int>(this.Position.x + this.Size.x + this.data.ImageOffsetX - (2 * this.deleteButton.Size.x / 3), this.Position.y + this.Size.y + this.data.ImageOffsetY - this.deleteButton.Size.y);
            this.deleteButton.Enabled  = false;

            this.editButton          = new EditBuildingButton(this);
            this.editButton.Position = new Pair <int>(this.Position.x + this.data.ImageOffsetX - (this.deleteButton.Size.x / 3), this.Position.y + this.Size.y + this.data.ImageOffsetY - this.deleteButton.Size.y);
            this.editButton.Enabled  = false;
        }
Пример #2
0
        /// <summary>
        /// Create an instance of a building ScreenElement
        /// </summary>
        public Building(Pair<int> position, Pair<int> size, BuildingData data)
            : base(position.y)
        {
            this.Clickable = true;
            this.Position = position;
            this.Size = size;
            this.data = data;

            this.deleteButton = new DeleteBuildingButton(this);
            this.deleteButton.Position = new Pair<int>(this.Position.x + this.Size.x + this.data.ImageOffsetX - (2 * this.deleteButton.Size.x / 3), this.Position.y + this.Size.y + this.data.ImageOffsetY - this.deleteButton.Size.y);
            this.deleteButton.Enabled = false;

            this.editButton = new EditBuildingButton(this);
            this.editButton.Position = new Pair<int>(this.Position.x + this.data.ImageOffsetX - (this.deleteButton.Size.x / 3), this.Position.y + this.Size.y + this.data.ImageOffsetY - this.deleteButton.Size.y);
            this.editButton.Enabled = false;
        }