public void Parse_RowPointsInstruction_Player1Points17()
		{
			var act = Instruction.Parse("update player1 row_points 17");
			var exp = new RowPointsInstruction(PlayerName.Player1, 17);

			Assert.AreEqual(exp, act);
		}
Пример #2
0
        internal static IInstruction Parse(string[] splited)
        {
            PlayerName name;

            if (splited.Length == 4 && Enum.TryParse <PlayerName>(splited[1], true, out name) && name != PlayerName.None)
            {
                switch (splited[2])
                {
                case "row_points": return(RowPointsInstruction.Parse(name, splited));

                case "combo": return(ComboInstruction.Parse(name, splited));

                case "skips": return(SkipsInstruction.Parse(name, splited));

                case "field": return(FieldInstruction.Parse(name, splited));
                }
            }
            return(null);
        }