예제 #1
0
        public BLResource BuyBuilding(String name, BLResource resources)
        {
            Building building = GetBuilding(name);

            foreach (ReqResource req in building.requirements)
            {
                resources.GetResource(req.resName).value -= req.value;
            }
            IncrementBuildingPrice("Hut");
            return resources;
        }
예제 #2
0
        public Boolean IsRequirementsMetForBuilding(String name, BLResource resources)
        {
            Building building = GetBuilding(name);

            foreach (ReqResource req in building.requirements)
            {
                if(req.value > resources.GetResource(req.resName).value)
                {
                    return false;
                }
            }
            return true;
        }