Esempio n. 1
0
    public void T02_Throwing8ReturnsTidy()
    {
        throws.Add(8);

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(tidy, nextAction);
    }
Esempio n. 2
0
 public void Setup()
 {
     throws  = new List <int>();
     endTurn = ActionManager.Action.EndTurn;
     tidy    = ActionManager.Action.Tidy;
     reset   = ActionManager.Action.Reset;
     endGame = ActionManager.Action.EndGame;
 }
Esempio n. 3
0
    public void T01_OneStrikeRetursnEndTurn()
    {
        throws.Add(10);

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(endTurn, nextAction);
    }
Esempio n. 4
0
    public void T05_ThrowingStrikeOnLastFrameReturnsReset()
    {
        AddNineFrames(throws);
        throws.Add(10);

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(reset, nextAction);
    }
Esempio n. 5
0
    private void OnActionSelected(ActionManager.Action action, Vector2 position)
    {
        endPos = position;
        if (lineCount > 0)
        {
            startPos = position;
        }

        DrawPath();
    }
Esempio n. 6
0
    public void T03_ThrowingSpareReturnsEndTurn()
    {
        throws.AddRange(new List <int>()
        {
            2, 8
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(endTurn, nextAction);
    }
 public void Perform(ActionManager.Action action)
 {
     if (action == ActionManager.Action.Tidy)
     {
         animator.SetTrigger("tidyTrigger");
     }
     else
     {
         animator.SetTrigger("resetTrigger");
     }
 }
Esempio n. 8
0
    public void T12_GutterBallAfterLastFrameStrikeShouldReturnTidy()
    {
        AddNineFrames(throws);
        throws.AddRange(new List <int>()
        {
            10, 0
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(tidy, nextAction);
    }
Esempio n. 9
0
    public void T09_ThrowingTwoBallsAfterLastFrameStrikeEndsGame()
    {
        AddNineFrames(throws);
        throws.AddRange(new List <int>()
        {
            10, 6, 2
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(endGame, nextAction);
    }
Esempio n. 10
0
    public void T08_ThrowingStrikeBallAfterLastFrameSpareEndsGame()
    {
        AddNineFrames(throws);
        throws.AddRange(new List <int>()
        {
            3, 7, 10
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(endGame, nextAction);
    }
Esempio n. 11
0
    public void T13_ThrowingGutterBallThenSpareReturnsEndTurnAndIncrementsThrowOnce()
    {
        throws.AddRange(new List <int>()
        {
            0, 10
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(endTurn, nextAction);
        //Assert.AreEqual(3, scoreManager.GetCurrentThrowNumber());
    }
Esempio n. 12
0
    public void T06_ThrowingSpareOnLastFrameReturnsReset()
    {
        AddNineFrames(throws);
        throws.AddRange(new List <int>()
        {
            3, 7
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(reset, nextAction);
    }
Esempio n. 13
0
    public void T04_ThrowingNoSpareOrStrikeOnLastFrameReturnsEndGame()
    {
        AddNineFrames(throws);
        throws.AddRange(new List <int>()
        {
            5, 1
        });

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(endGame, nextAction);
    }
Esempio n. 14
0
    public void T10_ThrowingTwoStrikesAfterLastFrameStrikeEndsGame()
    {
        AddNineFrames(throws);
        throws.Add(10);

        ActionManager.Action nextAction = ActionManager.GetNextAction(throws);

        Assert.AreEqual(reset, nextAction);
        throws.Add(10);
        Assert.AreEqual(reset, ActionManager.GetNextAction(throws));
        throws.Add(10);
        Assert.AreEqual(endGame, ActionManager.GetNextAction(throws));
    }
Esempio n. 15
0
 private Color GetColorBasedOnAction()
 {
     ActionManager.Action action = tileMode.CurrentAction;
     if (action == ActionManager.Action.Copy)
     {
         return(new Color(255, 209, 56));
     }
     else if (action == ActionManager.Action.Paste)
     {
         return(new Color(56, 255, 86));
     }
     else if (action == ActionManager.Action.Delete)
     {
         return(new Color(255, 94, 94));
     }
     return(Color.White);
 }
Esempio n. 16
0
 public void OnTileModeActionControl(ControlPanel cp)
 {
     if (CurrentAction == ActionManager.Action.Copy)
     {
         CurrentAction            = ActionManager.Action.Paste;
         cp.actionBtnIcon.texture = cp.pasteAction;
     }
     else if (CurrentAction == ActionManager.Action.Paste)
     {
         CurrentAction            = ActionManager.Action.Delete;
         cp.actionBtnIcon.texture = cp.deleteAction;
     }
     else if (CurrentAction == ActionManager.Action.Delete)
     {
         CurrentAction            = ActionManager.Action.Restore;
         cp.actionBtnIcon.texture = cp.restoreAction;
     }
     else if (CurrentAction == ActionManager.Action.Restore)
     {
         CurrentAction            = ActionManager.Action.Copy;
         cp.actionBtnIcon.texture = cp.copyAction;
     }
     CoreManager.ShowNotification(CoreManager.defaultNotificationTime, GetOnActionControlMsg());
 }
Esempio n. 17
0
 private void OnActionSelected(ActionManager.Action action, Vector2 position)
 {
     actions.Enqueue(Walk(position));
     actions.Enqueue(Wait(timeBetweenActions));
 }
Esempio n. 18
0
 public ActionAttr(ActionManager.Action action)
 {
     Action = action;
 }