public boolean changePattern ( FormationPattern < T > pattern ) { // Find out how many slots we have occupied int occupiedSlots = slotAssignments . size ; // Check if the pattern supports one more slot if ( pattern . supportsSlots ( occupiedSlots ) ) { setPattern ( pattern ) ; // Update the slot assignments and return success updateSlotAssignments ( ) ; return true ; } return false ; }
Changes the pattern of this formation and updates slot assignments if the number of member is supported by the given pattern .