コード例 #1
0
    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);
    }
コード例 #2
0
    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);
        }
    }
コード例 #3
0
    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);
    }
コード例 #4
0
    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);
    }