示例#1
0
    public void T02_Throwing8ReturnsTidy()
    {
        throws.Add(8);

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

        Assert.AreEqual(tidy, nextAction);
    }
示例#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;
 }
示例#3
0
    public void T01_OneStrikeRetursnEndTurn()
    {
        throws.Add(10);

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

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

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

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

        DrawPath();
    }
示例#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");
     }
 }
示例#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);
    }
示例#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);
    }
示例#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);
    }
示例#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());
    }
示例#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);
    }
示例#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);
    }
示例#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));
    }
示例#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);
 }
示例#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());
 }
示例#17
0
 private void OnActionSelected(ActionManager.Action action, Vector2 position)
 {
     actions.Enqueue(Walk(position));
     actions.Enqueue(Wait(timeBetweenActions));
 }
示例#18
0
 public ActionAttr(ActionManager.Action action)
 {
     Action = action;
 }