public void ReplaceCurrentReplayData(SCMatchRecord newValue) { var index = GameComponentsLookup.CurrentReplayData; var component = (CurrentReplayDataComponent)CreateComponent(index, typeof(CurrentReplayDataComponent)); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetCurrentReplayData(SCMatchRecord newValue) { if (hasCurrentReplayData) { throw new Entitas.EntitasException("Could not set CurrentReplayData!\n" + this + " already has an entity with CurrentReplayDataComponent!", "You should check if the context already has a currentReplayDataEntity before setting it or use context.ReplaceCurrentReplayData()."); } var entity = CreateEntity(); entity.AddCurrentReplayData(newValue); return(entity); }
public void ReplaceCurrentReplayData(SCMatchRecord newValue) { var entity = currentReplayDataEntity; if (entity == null) { entity = SetCurrentReplayData(newValue); } else { entity.ReplaceCurrentReplayData(newValue); } }