< Summary

Class:RecipeState2
Assembly:Test
File(s):E:/Unity/Unity Project/VR-Cooking-Demo/Assets/_Scripts/Recipe States/RecipeState2.cs
Covered lines:0
Uncovered lines:22
Coverable lines:22
Total lines:59
Line coverage:0% (0 of 22)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:4
Method coverage:0% (0 of 4)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
EnterState(...)0%0000%
Update()0%0000%
FixedUpdate()0%0000%
MoveToStep3()0%0000%

File(s)

E:/Unity/Unity Project/VR-Cooking-Demo/Assets/_Scripts/Recipe States/RecipeState2.cs

#LineLine coverage
 1/*
 2 *
 3 * Code by:
 4 *      Dimitrios Vlachos
 5 *      djv1@student.london.ac.uk
 6 *      dimitri.j.vlachos@gmail.com
 7 *
 8 * Adapted from our Games Dev FSM lecture
 9 *
 10 */
 11
 12using System.Collections;
 13using System.Collections.Generic;
 14using UnityEngine;
 15
 16/// <summary>
 17/// State <c>RecipeState1</c> is the second step of the recipe, chopping carrots
 18/// </summary>
 19public class RecipeState2 : RecipeBaseState
 20{
 21    public override void EnterState(RecipeManager rm)
 022    {
 023        base.EnterState(rm);
 24
 25        // Set text
 026        objective.text = "\nChop carrot into thin slices.\n" +
 27                         "(10 slices - 1g minimum)";
 28
 029        status.text = "\n\n\n0 / 10 carrot slices";
 030    }
 31
 32    public override void Update()
 033    {
 034        numberOfCarrots = potBehaviour.numCarrots;
 35
 036        if (numberOfCarrots < 10)
 037        {
 038            status.text = "\n\n\n" + numberOfCarrots + " / 10 carrot slices";
 039        }
 40        else
 041        {
 042            status.text = "\n\n\n" + numberOfCarrots + " / 10 carrot slices" +
 43                "\n Objective complete!";
 044            recipeManager.StartCoroutine(MoveToStep3());
 045        }
 046    }
 47
 48    public override void FixedUpdate()
 049    {
 50        // Do nothing
 051    }
 52
 53    IEnumerator MoveToStep3()
 054    {
 055        yield return new WaitForSeconds(4);
 56        //recipeManager.MoveToState(recipeManager.state2);
 057        Debug.Log("Not there yet!");
 058    }
 59}