/*================================================================
Product:    GGJ-2017
Developer:  Onur Tanrıkulu
Company:    Onur Tanrikulu
Date:       21/01/2017 03:51

Copyright (c) 2017 Onur Tanrikulu. All rights reserved.
================================================================*/

public class Power
{
   #region Fields
    private float chargedPower;
    private const float maxChargedPower = 5f;
   #endregion
 
   #region Constructors
    public Power()
    {
        ResetCharge();
    }
   #endregion
 
   #region Properties
    public bool HasOverCharged
    {
        get;
        private set;
    }

    public bool IsCharging
    {
        get;
        set;
    }

    public float ChargedPower
    {
        get
        {
            return chargedPower;
        }
        set
        {
            if (value >= maxChargedPower)
            {
                HasOverCharged = true;
            }
            else
            {
                chargedPower = value;
            }
        }
    }
   #endregion
 
   #region Methods
    public void ResetCharge()
    {
        HasOverCharged = false;
        IsCharging = true;
        ChargedPower = 0;
    }
   #endregion
}
