Remove() Methods

v4.0

Example code here is from GameStatList.cs, though similar methods are on other list classes as well.

Methods for specific list types are below.

The common methods can be found in GameModuleListExtensions.cs

Remove()

There are many ways to remove an item from the list

// Remove by Stat, GameStat, or uid
gameStatList.Remove(stat);
gameStatList.Remove(gameStat);
gameStatList.Remove(uid);

// Remove all by Stat, GameStat, or uid
gameStatList.RemoveAll(stat);
gameStatList.RemoveAll(gameStat);
gameStatList.RemoveAll(uid);

// Remove by a gameId -- These do the same thing
gameStatList.RemoveGameId(gameId);
gameStatList.RemoveExact(gameId);

// Remove an exact Game Module Object
gameStatList.RemoveExact(gameStat); // pass in the gameStat we want to remove

// Clear the entire list
gameStatList.Clear();

GameConditionList

Remove all from a specific IHaveStats source

Expire all from a specific IHaveStats source

GameItemObjectList

Remove all based on number of ItemAttributes

Remove all based on specific ItemAttributes

Remove duplicates

These methods will remove any duplicates. The single-object methods have an optional itemObjectUid, when null, will remove any duplicate in the entire list.

There is also an optional bool includeItemAttributes, which is false by default. When true, a GameItemObject must match both its Uid() and its list of ItemAttributes to qualify as a duplicate.

Last updated

Was this helpful?