OrderedList
Introduction
Code Example
// The following code moves the calling object to the next level
public void SetNextLevel()
{
// Assumes the object has a CurrentLevel type which is of type LevelInfo
// (presumably from a CSV called LevelInfo.cs)
// This also assumes that "Name" is the key used in the dictionary
// OrderedList is a static property:
int indexOfCurrent = LevelInfo.OrderedList.IndexOf(CurrentLevel.Name);
if(index < LevelInfo.OrderedList.Count)
{
string nextLevelKey = LevelInfo.OrderedList[indexOfCurrent + 1];
CurrentLevel = GlobalContent.LevelInfo[nextLevelKey];
}
else
{
// Last level, handle appropriately
}
}Last updated
Was this helpful?