public void ReplaceTransactionMapObject(Features.Config.MapObject newMapObject) { var index = GameComponentsLookup.TransactionMapObject; var component = (Features.Components.Transaction.TransactionMapObjectComponent)CreateComponent(index, typeof(Features.Components.Transaction.TransactionMapObjectComponent)); component.MapObject = newMapObject; ReplaceComponent(index, component); }
public void ReplaceMapObjectPlacement(Features.Config.MapObject newValue) { var index = GameComponentsLookup.MapObjectPlacement; var component = (Features.Components.MapObjectPlacementComponent)CreateComponent(index, typeof(Features.Components.MapObjectPlacementComponent)); component.Value = newValue; ReplaceComponent(index, component); }
public GameEntity SetMapObjectPlacement(Features.Config.MapObject newValue) { if (hasMapObjectPlacement) { throw new Entitas.EntitasException("Could not set MapObjectPlacement!\n" + this + " already has an entity with Features.Components.MapObjectPlacementComponent!", "You should check if the context already has a mapObjectPlacementEntity before setting it or use context.ReplaceMapObjectPlacement()."); } var entity = CreateEntity(); entity.AddMapObjectPlacement(newValue); return(entity); }
public void ReplaceMapObjectPlacement(Features.Config.MapObject newValue) { var entity = mapObjectPlacementEntity; if (entity == null) { entity = SetMapObjectPlacement(newValue); } else { entity.ReplaceMapObjectPlacement(newValue); } }