30 lines
581 B
C#
30 lines
581 B
C#
using Godot;
|
|
|
|
public class GameResource
|
|
{
|
|
int maxAmount;
|
|
int currentAmount;
|
|
bool isEndless;
|
|
float extractionSpeed;
|
|
public string name;
|
|
|
|
public GameResource(string name)
|
|
{
|
|
this.name = name;
|
|
maxAmount = GameData.rand.Next(1000, 10000);
|
|
currentAmount = maxAmount;
|
|
isEndless = false;
|
|
extractionSpeed = 1f;
|
|
}
|
|
|
|
public bool Extract()
|
|
{
|
|
if(isEndless) return true;
|
|
if (currentAmount > 0)
|
|
{
|
|
currentAmount--;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
} |