private void ShowWithUserAction(ActionString withUserString) { ActionCard.ActionType insideType = (ActionCard.ActionType)Enum.Parse(typeof(ActionCard.ActionType), withUserString.variables[0]); withUserString.variables[0] = EditorGUILayout.EnumPopup("InsideType", insideType).ToString(); ActionString moneyString = ActionString.FromString(withUserString.variables[1]); ActionString waitString = ActionString.FromString(withUserString.variables[2]); ActionString moveString = ActionString.FromString(withUserString.variables[3]); //Pomijamy indeks 4, bo jest to ActionType.WithUser switch (insideType) { case ActionCard.ActionType.Money: ShowMoneyAction(moneyString); break; case ActionCard.ActionType.Wait: ShowWaitAction(waitString); break; case ActionCard.ActionType.Move: ShowMoveAction(moveString); break; } withUserString.variables[1] = moneyString.ToString(); withUserString.variables[2] = waitString.ToString(); withUserString.variables[3] = moveString.ToString(); }
public void CreateActionString() { var s = new ActionString("a,b,c,d,e,f"); Assert.AreEqual("a", s.location); Assert.AreEqual("b", s.first); Assert.AreEqual("c", s.second); Assert.AreEqual(new [] { "d", "e", "f" }, s.third); Assert.AreEqual("a,b,c,d,e,f", s.ToString()); }