// if this prop is locked, the men on it will be locked as well // and the men who are heading to it will be dismissed public override void Lock() { base.Lock(); for (int i = 0; i < slots.Count; ++i) { SlotAttr slot = slots[i]; if (slot.state == SlotState.PLANNED) { Services.gameEvents.ImmediateUnboundMan(slot.man, gameObject, i); } } }
//public int GetSlotId(GameObject man) //{ // for (int i = 0; i < slots.Count; ++i) // { // if (slots[i].man == man) // { // return i; // } // } // return -1; //} public virtual int FindEmptySlot() { if (IsLocked()) { return(-1); } for (int i = 0; i < slots.Count; ++i) { SlotAttr slot = slots[i]; if (slot.state == SlotState.EMPTY) { return(i); } } return(-1); }