using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assets.Scripts.Network
{
    public class DrainableResource
    {
        public float Capacity = 1;
        public float DrainRate = 0.0001f;
        public float Level = 1;
        public bool Drain = true;

        public void Update (float FrameTime )
        {
            if (!World.currentWorld.IsFake)
                return;

            if ( Drain )
            {
                Level -= DrainRate * FrameTime;
                if (Level < 0)
                    Level = 0;
            }
        }

        public bool IsDead()
        {
            return Level == 0;
        }
    }
}
