public static bool IsEmpty(ComponentUpdateResults results) { lock (padLock) { return(ReferenceEquals(results, emptyResults)); } }
public IEnumerable <ComponentUpdateResults> Update(GameTime gameTime) { List <ComponentUpdateResults> results = new List <ComponentUpdateResults>(); for (int i = 0; i < components.Count; i++) { if (components[i].Destroyed) { ComponentRemoved(this, new ComponentRemovedEventArgs(components[i])); components.Remove(components[i]); continue; } ComponentUpdateResults result = components[i].Update(gameTime, results); if (ComponentUpdateResults.IsEmpty(result)) { continue; } results.Add(result); } for (int i = 0; i < results.Count; i++) { GameObjectComponent component = components.Find(c => results[i].CreatedThis(c)); if (results[i].BlockNextUpdate) { component.SkipUpdate(); } } return(results); }
static ComponentUpdateResults() { emptyResults = new ComponentUpdateResults(); }