using System.Collections;
using System.Collections.Generic;

namespace NBuilding
{
    public abstract class ABuilding : IBuilding
    {
        //----------------------------------------------------------------------------
        // private object variables

        private int _runningCost = 0;
        private int _scienceCapacity = 0;
        private int _foodCapacity = 0;
        private int _industrialCapacity = 0;
        private int _moneyCapacity = 0;

        private int _militaryPower = 0;

        private bool _isRunning = true;

        private ABuilding.BuildingID _iD = 0;

        //----------------------------------------------------------------------------
        // 

        public enum BuildingID
        {
            Farm,
            Smeltery,
            Armory,
            Spaceport,
            Market,
            University
        }

        //----------------------------------------------------------------------------
        // Getters

        public int GetRunningCost()
        {
            if (_isRunning)
            {
                return _runningCost;
            }
            else
            {
                return 0;
            }
        }

        public int GetScienceCapacity()
        {
            if (_isRunning)
            {
                return _scienceCapacity;
            }
            else
            {
                return 0;
            }
        }

        public int GetFoodCapacity()
        {
            if (_isRunning)
            {
                return _foodCapacity;
            }
            else
            {
                return 0;
            }
        }

        public int GetIndustrialCapacity()
        {
            if (_isRunning)
            {
                return _industrialCapacity;
            }
            else
            {
                return 0;
            }
        }

        public int GetMoneyCapacity()
        {
            if (_isRunning)
            {
                return _moneyCapacity;
            }
            else
            {
                return 0;
            }
        }

        public int GetMilitaryPower()
        {
            if (_isRunning)
            {
                return _militaryPower;
            }
            else
            {
                return 0;
            }
        }

        public bool IsRunning()
        {
            return _isRunning;
        }

        public ABuilding.BuildingID GetId()
        {
            return _iD;
        }

        //----------------------------------------------------------------------------
        // Setters

        public void SetRunningCost(int newRunningCost)
        {
            if (newRunningCost > 0)
            {
                _runningCost = newRunningCost;
            }
        }

        public void SetScienceCapacity(int newScienceCapacity)
        {
            if (newScienceCapacity >= 0)
            {
                _scienceCapacity = newScienceCapacity;
            }
        }

        public void SetFoodCapacity(int newFoodCapacity)
        {
            if (newFoodCapacity >= 0)
            {
                _foodCapacity = newFoodCapacity;
            }
        }

        public void SetIndustrialCapacity(int newIndustrialCapacity)
        {
            _industrialCapacity = newIndustrialCapacity;
        }

        public void SetMoneyCapacity(int newMoneyCapacity)
        {
            if (newMoneyCapacity >= 0)
            {
                _moneyCapacity = newMoneyCapacity;
            }
        }

        public void SetMilitaryPower(int newMilitaryPower)
        {
            if (newMilitaryPower >= 0)
            {
                _militaryPower = newMilitaryPower;
            }
        }

        public void SetRunning(bool newRunning)
        {
            _isRunning = newRunning;
        }

        public void SetId(ABuilding.BuildingID newId)
        {
            _iD = newId;
        }
        //----------------------------------------------------------------------------
        //


    }
}