示例#1
0
        public float ExtractOutResource(ResourceStorage.Resource res, float amount)
        {
            float output = clamp(amount, ResourceOutput[(int)res]);

            ResourceOutput[(int)res] = clamp(ResourceOutput[(int)res] - output);
            return(output);
        }
示例#2
0
 public SimulationBuildingEnity()
 {
     ResouceAmount = new float[ResourceStorage.ResourceCount];
     ResourceConsumptionPerSecond = new float[ResourceStorage.ResourceCount];
     ResourceMaxAmount            = new float[ResourceStorage.ResourceCount];
     ConsumingResource            = new bool[ResourceStorage.ResourceCount];
     ConvertsTo     = new ResourceStorage.Resource[ResourceStorage.ResourceCount];
     ProduceRate    = new float[ResourceStorage.ResourceCount];
     ResourceOutput = new float[ResourceStorage.ResourceCount];
 }
示例#3
0
 public float GetAvailableOutResource(ResourceStorage.Resource res)
 {
     return(ResourceOutput[(int)res]);
 }
示例#4
0
 public float GetResourceConsumption(ResourceStorage.Resource res)
 {
     return(ResourceConsumptionPerSecond[(int)res]);
 }
示例#5
0
 public float GetMaxResourceAmount(ResourceStorage.Resource res)
 {
     return(ResourceMaxAmount[(int)res]);
 }
示例#6
0
 public float GetResource(ResourceStorage.Resource res)
 {
     return(ResouceAmount[(int)res]);
 }
示例#7
0
 public void AddResource(ResourceStorage.Resource res, float amount)
 {
     ResouceAmount[(int)res] = clamp(ResouceAmount[(int)res] + amount);
 }