public void ReplaceCardProspector(int newLayoutID, Bartok.SlotDef newSlotDef) { var index = GameComponentsLookup.CardProspector; var component = CreateComponent <Bartok.CardProspectorComponent>(index); component.layoutID = newLayoutID; component.slotDef = newSlotDef; ReplaceComponent(index, component); }
public void ReplaceGameBoard(UnityEngine.Vector2 newMultiplier, System.Collections.Generic.List <Bartok.SlotDef> newSlotDefs, Bartok.SlotDef newDrawPile, Bartok.SlotDef newDiscardPile) { var entity = gameBoardEntity; if (entity == null) { entity = SetGameBoard(newMultiplier, newSlotDefs, newDrawPile, newDiscardPile); } else { entity.ReplaceGameBoard(newMultiplier, newSlotDefs, newDrawPile, newDiscardPile); } }
public void ReplaceGameBoard(UnityEngine.Vector2 newMultiplier, System.Collections.Generic.List <Bartok.SlotDef> newSlotDefs, Bartok.SlotDef newDrawPile, Bartok.SlotDef newDiscardPile) { var index = GameComponentsLookup.GameBoard; var component = CreateComponent <Bartok.GameBoardComponent>(index); component.multiplier = newMultiplier; component.slotDefs = newSlotDefs; component.drawPile = newDrawPile; component.discardPile = newDiscardPile; ReplaceComponent(index, component); }
public GameEntity SetGameBoard(UnityEngine.Vector2 newMultiplier, System.Collections.Generic.List <Bartok.SlotDef> newSlotDefs, Bartok.SlotDef newDrawPile, Bartok.SlotDef newDiscardPile) { if (hasGameBoard) { throw new Entitas.EntitasException("Could not set GameBoard!\n" + this + " already has an entity with Bartok.GameBoardComponent!", "You should check if the context already has a gameBoardEntity before setting it or use context.ReplaceGameBoard()."); } var entity = CreateEntity(); entity.AddGameBoard(newMultiplier, newSlotDefs, newDrawPile, newDiscardPile); return(entity); }