public static List<QueuedCommand> QueuedCommandList(Command C, Galaxy g) { List<QueuedCommand> qcs = new List<QueuedCommand>(); int dist = ((Ship)(g.GetHex(C.start).GetGameObject())).getSpeed(); for (int i = 0; i < dist; i++) { qcs.Add(new QueuedCommand(C, g, i)); } return qcs; }
public QueuedCommand(Command C, Galaxy g, int offset) { agent = (Unit)g.GetHex(C.start).GetGameObject(); try { targetHex = g.GetHex(C.target); } catch (NullReferenceException) { targetHex = null; } order = C.action; shiptype = C.shiptype; priority = 10*(int)order+offset; }
public void AddCommand(Command c) { commands.Add(c); }