public boolean addMember ( FormationMember < T > member ) { // Find out how many slots we have occupied int occupiedSlots = slotAssignments . size ; // Check if the pattern supports one more slot if ( pattern . supportsSlots ( occupiedSlots + 1 ) ) { // Add a new slot assignment slotAssignments . add ( new SlotAssignment < T > ( member , occupiedSlots ) ) ; // Update the slot assignments and return success updateSlotAssignments ( ) ; return true ; } return false ; }
Adds a new member to the first available slot and updates slot assignments if the number of member is supported by the current pattern .