public void ResourceGathered(Unit unit, ResourceManager.ResourceType type) { if (onResourceGathered != null) { onResourceGathered(unit, type); } }
Resource(ResourceManager.ResourceType type, int amount, int costWork) { // This constructor is used for the creation of resource tiles // and also defines the work cost to harvest this.type = type; this.amount = amount; this.costWork = costWork; }
public Resource(GameObject go, int max, ResourceManager.ResourceType res, int rate, int rm) { _age = new TimeManager(go); _humanMax = max; resourceT = res; _ratePerMonth = rate; humans = new List <Human> (); resourceMax = rm; currentResources = resourceMax; GameController.instance.gameManager.resourceManager.AddResource(this); }
public static bool hasStorageRoom(ResourceManager.ResourceType type, int amount) { if (type == ResourceManager.ResourceType.Wood) { return(Wood + amount <= woodMax); } if (type == ResourceManager.ResourceType.Stone) { return(Stone + amount <= stoneMax); } return(false); }
public void UpdatePanel(Unit unit, ResourceManager.ResourceType type) { selectedUnit = unit; if (selectedUnit) { unitName.text = $"Unit: {selectedUnit.gameObject.name}"; unitMoves.text = $"Moves: {selectedUnit.remainingMoves}"; Debug.Log("Updated Unit panel"); } else { Debug.Log("No unit selected: panel not updated"); } }
void OnEnable() { if (this.tag == TagHandler.buildingWoodStorageString) { type = ResourceManager.ResourceType.Wood; } else if (this.tag == TagHandler.buildingStoneStorageString) { type = ResourceManager.ResourceType.Stone; } // Add to PlayerResources storage list at start ResourceManager.AddRemoveStorage(this, MethodHandler.Command.Add); }
Resource(ResourceManager.ResourceType type, int amount) { // This constructor is used for carried item creation of the resource this.type = type; this.amount = amount; }
public static bool IsResourceTypeSupported(ResourceManager.ResourceType resourceType) { return(supportedResourceTypes.Contains(resourceType)); }
public static void RegisterResourceType(ResourceManager.ResourceType resourceType) { supportedResourceTypes.AddWithCheckAlreadyContained(resourceType); }