public void Parse_ComboInstruction_Player2Points3() { var act = Instruction.Parse("update player2 combo 3"); var exp = new ComboInstruction(PlayerName.Player2, 3); Assert.AreEqual(exp, act); }
private ComboInstruction GetComboInstruction(CharReader cr) { var newInstruction = new ComboInstruction(); while (cr.HasCharacters()) { var c = cr.GetChar(); if (c == '[' || c == ']' || c == '.' || c == ',') { break; } if (c == '+') { newInstruction.Add(); } if (c == '-') { newInstruction.Subtract(); } if (c == '<') { newInstruction.ShiftLeft(); } if (c == '>') { newInstruction.ShiftRight(); } cr.Forward(); } cr.Back(); return(newInstruction); }