public SimState(Snapshot initialSnapshot) { InitialSnapshot = (Snapshot)initialSnapshot.Clone(); Snapshots.Add(0, (Snapshot)initialSnapshot.Clone()); EntityID largestEntityID = 0; foreach (SimComponent component in CurrentSnapshot.GetComponents()) { if (component.EntityID > largestEntityID) { largestEntityID = component.EntityID; } } NextEntityID = largestEntityID + 1; }
public IEnumerable <SimComponent> GetComponents() { return(CurrentSnapshot.GetComponents()); }
public IEnumerable <T> GetComponents <T>() where T : SimComponent { return(CurrentSnapshot.GetComponents <T>()); }