/** * Creates an action list with given number of slots * @param length Number of slots to create */ public MDRActionList(int length) { Slot = new MDRAction[length]; for (int lp = 0; lp < length; lp++) { Slot[lp] = new MDRAction(ActionType.Empty); } }
/** If this list contains given action */ public bool Contains(MDRAction action, bool deepCompare = false) { foreach (MDRAction slot in Slot) { if (deepCompare) { if (slot.CompareTo(action)) { return(true); } else if (slot == action) { return(true); } } } return(false); }
/** Returns true if this action is the same as given action */ public bool CompareTo(MDRAction otherAction) { return((this.Type == otherAction.Type) && (this.Parameter == otherAction.Parameter)); }
/** Copyies another action this this action */ public void CopyFrom(MDRAction source) { this._type = source.Type; this._parameter = source.Parameter; }