예제 #1
0
    public bool Heal(float cooldown, FarmTool tool)
    {
        var readyForState = ReadyForState(State.Growing);

        if (readyForState == StateReady.Ready && _state == State.Decay && _interActable)
        {
            soundEffectManager.SoundPesticide();

            _cooldown = cooldown;
            CultivateToState(State.Healing);
            return(true);
        }
        else
        {
            if (readyForState == StateReady.OnCooldown)
            {
                Notify(new PlotOnCooldownWarningEvent(this, tool));
            }
            else
            {
                Notify(new WrongToolOnPlotWarningEvent(this, tool));
            }
            Debug.Log("Not allowed");
            return(false);
        }
    }
예제 #2
0
    public bool Dig(float cooldown, FarmTool tool)
    {
        var readyForState = ReadyForState(State.Dug);

        if (readyForState == StateReady.Ready && _interActable)
        {
            soundEffectManager.SoundDig();

            _cooldown = cooldown;
            CultivateAfterCooldown(State.Dug);
            return(true);
        }
        else
        {
            if (readyForState == StateReady.OnCooldown)
            {
                Notify(new PlotOnCooldownWarningEvent(this, tool));
            }
            else
            {
                Notify(new WrongToolOnPlotWarningEvent(this, tool));
            }
            Debug.Log("Not allowed");
            return(false);
        }
    }
예제 #3
0
 public WrongToolOnPlotWarningEvent(FarmPlot farmPlot, FarmTool farmTool) : base(farmPlot)
 {
     this.farmPlot = farmPlot;
     this.farmTool = farmTool;
 }
예제 #4
0
 public ToolOnCooldownWarningEvent(FarmTool farmTool) : base(farmTool)
 {
     this.farmTool = farmTool;
 }
예제 #5
0
 public PlotOnCooldownWarningEvent(FarmPlot farmPlot, FarmTool farmTool) : base(farmPlot)
 {
     this.farmPlot = farmPlot;
     this.farmTool = farmTool;
 }
예제 #6
0
 public static bool Heal(FarmPlot plot, float cooldown, FarmTool tool)
 {
     return(plot.Heal(cooldown, tool));
 }
예제 #7
0
 public static bool Water(FarmPlot plot, float cooldown, FarmTool tool)
 {
     return(plot.Water(cooldown, tool));
 }
예제 #8
0
 public static bool Plant(FarmPlot plot, float cooldown, FarmTool tool)
 {
     return(plot.Plant(cooldown, tool));
 }
예제 #9
0
 public static bool Dig(FarmPlot plot, float cooldown, FarmTool tool)
 {
     return(plot.Dig(cooldown, tool));
 }