Exemplo n.º 1
0
 private PhysicalResource FindPhysical(PhysicalRef resourceName)
 {
     foreach (PhysicalResource p in Resources)
     {
         if (p.Name == resourceName)
         {
             return(p);
         }
     }
     return(null);
 }
Exemplo n.º 2
0
    public void AddToValue(PhysicalRef resourceName, float amount)
    {
        PhysicalResource pr = FindPhysical(resourceName);

        if (pr.PhysicalValue + (pr.Threshold * amount) > 1.0f)
        {
            pr.PhysicalValue = 1.0f;
        }
        else
        {
            pr.PhysicalValue += pr.Threshold * amount;
        }
    }
Exemplo n.º 3
0
 public float GetPhysicalThreshold(PhysicalRef resourceName)
 {
     return(FindPhysical(resourceName).Threshold);
 }
Exemplo n.º 4
0
 public float GetPhysicalDecay(PhysicalRef resourceName)
 {
     return(FindPhysical(resourceName).Decay);
 }
Exemplo n.º 5
0
 public float GetPhysicalValue(PhysicalRef resourceName)
 {
     return(FindPhysical(resourceName).PhysicalValue);
 }