Ejemplo n.º 1
0
        private Point GetCellToCoordinates(ReplayReplayStepRulesEventBoardAction boardAction)
        {
            Cell  cell   = boardAction.Order[0].CellTo[0];
            Point result = new Point(cell.x, cell.y);

            return(result);
        }
Ejemplo n.º 2
0
        public BoardAction(ReplayReplayStepRulesEventBoardAction boardAction, MatchResult matchResult, bool isCoachChoice)
        {
            if (boardAction.PlayerId != null)
            {
                actingPlayerName = matchResult.GetPlayerFromID(int.Parse(boardAction.PlayerId)).name;
            }

            switch (boardAction.ActionType)
            {
            case "6": actionDescription = "knocked over"; break;

            case "7": actionDescription = "kicks"; break;

            case "8": actionDescription = "ball scatters"; break;

            case "12": actionDescription = "KO recovery"; break;

            case "42": actionDescription = "blocks"; break;

            default: actionDescription = "Unknown action " + boardAction.ActionType; break;
            }

            if (boardAction.Order != null)
            {
                //get cell to and cell from coordinates here
            }

            description = actingPlayerName + " " + actionDescription;

            if (boardAction.Results != null)
            {
                //get dice details here, skills used etc.
                for (int i = 0; i < boardAction.Results.Length; i++)
                {
                    rollType     = boardAction.Results[i].RollType;
                    description += " Roll Type: " + rollType;
                    if (boardAction.Results[i].CoachChoices != null)
                    {
                        dice         = boardAction.Results[i].CoachChoices[0].ListDices;
                        description += " Dice: " + dice;
                        target       = boardAction.Results[i].Requirement;
                        description += " Target: " + target;
                    }
                }
            }

            //rollType = boardAction.Results[0].RollType;
            //dice = boardAction.Results[0].CoachChoices[0].ListDices;
            //if ( boardAction.ActionType == "42")
            //{
            //    //block
            //    //choosing block dice
            //    description = actingPlayerName + " blocks";

            //}
            //if (boardAction.ActionType == "1")
            //{
            //    if (isCoachChoice && rollType == "5")
            //    {
            //        description = actingPlayerName + " chooses " + dice;
            //    }
            //    else
            //    {
            //        description = " Dice: " + boardAction.Results[0].CoachChoices[0].ListDices;
            //    }

            //}
        }