Ejemplo n.º 1
0
    public void NextStage()
    {
        currentStage++;

        if (currentStage > 3)
        {
            currentStage = 0;
        }

        ActivateStage(currentStage);

        switch (currentStage)
        {
        case 1:
            casting.enabled = true;
            casting.StartCasting();
            break;

        case 2:
            FishLibrary.castPower = casting.CollectData();
            casting.enabled       = false;
            caughtFish            = school.CalcFish();
            catching.SetFish(caughtFish);
            catching.enabled = true;
            break;

        case 3:
            bool result = catching.CollectData();
            catching.enabled = false;
            if (result)
            {
                if (!caughtFish.isCaught)
                {
                    caughtFish.isCaught = true;
                    FishLibrary.numFishCaught++;
                }

                results.Results(caughtFish);
            }
            else
            {
                results.Failure();
            }
            break;

        case 0:
            casting.enabled  = false;
            catching.enabled = false;
            break;
        }
    }