void ParseSACTION(string[] data) { int x1 = int.Parse(data [1]); int y1 = int.Parse(data [2]); int x2 = int.Parse(data [3]); int y2 = int.Parse(data [4]); string actionType = data [5]; int x3 = int.Parse(data [6]); int y3 = int.Parse(data [7]); int actionId = int.Parse(data [8]); //TODO: itemId ? Unit unit = BoardGenerator.GetUnitAtCoord(x1, y1); Tile destinationTile = BoardGenerator.tiles [BoardGenerator.CoordToIndex(x2, y2)]; if (unit == null) { unit = GameplayManager.Instance.UnitSelected; } bool didMove = unit.MoveTo(destinationTile); Tile attackedTile = BoardGenerator.tiles [BoardGenerator.CoordToIndex(x3, y3)]; int attackSucceeded = -1; switch (actionType) { case "atk": attackSucceeded = unit.Attack(attackedTile); break; case "atkspeone": attackSucceeded = unit.UseFirstAbility(attackedTile); break; case "atkspetwo": attackSucceeded = unit.UseSecondAbility(); break; case "atkspethree": attackSucceeded = unit.UseThirdAbility(); break; case "compspe": attackSucceeded = unit.UseSpecialAbility(attackedTile); break; case "obj": //unit.UseObject(attackedTile); break; case "NOTHING": break; } TurnManager.Instance.NextTurn(); }