void
CThingyList::ValidateList() {
	UInt32 numThingys = GetCount(); 
	for (int i = numThingys; i > 0; i--) { // start at the end so we can safely remove items
    	ThingyRef* aRefP = (ThingyRef*) GetItemPtr(i);
    	AGalacticThingy* aThingy = aRefP->GetThingy();
    	aThingy = ValidateThingy(aThingy);
    	if (aThingy == NULL) {
    		DEBUG_OUT("ThingyList has invalid reference at index "<<i << " to id "<<aRefP->GetThingyID()<<"; Removed", DEBUG_ERROR | DEBUG_CONTAINMENT );
            RemoveItemsAt(1, i);
    	} else if (mIsShipsOnly) {
    	    if ( ! ValidateShip(aThingy) ) {
        		DEBUG_OUT("Ship Only ThingyList has reference at index "<<i << " to non-ship item "<<aThingy<<"; Removed", DEBUG_ERROR | DEBUG_CONTAINMENT );
                RemoveItemsAt(1, i);
    	    }
    	}
	}  
}
void
CThingyList::ReadStream(LStream& inInputStream, UInt32 streamVersion) {
  #warning TODO: should only update items that are not already in correct position in the list
	RemoveItemsAt(GetCount(), 1);	// clear all the item from the array
	UInt16 numThingys;
	inInputStream >> numThingys;	// read in the object count
	for (long i = 1; i <= numThingys; i++) {	// now read in that many objects
		ThingyRef aRef;
		inInputStream >> aRef;
		DEBUG_OUT(" |-- "<<aRef, DEBUG_TRIVIA | DEBUG_CONTAINMENT );
/*  #warning FIXME: this debug code is correcting errors that will kill a release version
	  #ifdef DEBUG
		ArrayIndexT idx = FetchIndexOf(aRef);
		if (idx != index_Bad) {	// make sure we don't have duplicate entries
			DEBUG_OUT(" |    Duplicate entry "<<aRef <<" in "<<this<<" -- skipped", DEBUG_ERROR | DEBUG_CONTAINMENT );
			continue;
		}
	  #else
	     #error critical debug code not included
	  #endif */
		InsertItemsAt(1, LArray::index_Last, aRef);
	}
}
void
BTextView::LineBuffer::RemoveLines(int32 index, int32 count)
{
	RemoveItemsAt(count, index);
}
Exemple #4
0
void
_BStyleRunDescBuffer_::RemoveDescs(int32 index, int32 count)
{
	RemoveItemsAt(count, index);
}