示例#1
0
 public void SetOwnerZone(CardZoneMaster zone)
 {
     if (Zone != zone)
     {
         Zone = zone;
         OwnerZoneChangedEvent?.Invoke(Zone);
     }
 }
示例#2
0
    protected override void OnRefresh()
    {
        SeatPhaseTag = Entity.GetComponent <SeatPhaseTag>();
        CardZone[] cardZones = Enum.GetValues(typeof(CardZone)) as CardZone[];

        for (int i = 0; i < cardZones.Length; i++)
        {
            CardZoneMaster cardZoneMaster = Entity.GetComponent <CardZoneMaster>(x => x.CardZoneTag?.CardZone == cardZones[i]);
            if (cardZoneMaster != null)
            {
                _cardZones[cardZones[i]] = cardZoneMaster;
            }
            else
            {
                _cardZones.Remove(cardZones[i]);
            }
        }
    }
示例#3
0
    public static void MoveToZone(Entity entity, CardZoneMaster zone)
    {
        InsideZoneTag ownerZoneTag = entity.GetComponent <InsideZoneTag>();

        if (ownerZoneTag != null)
        {
            if (zone == null)
            {
                entity.RemoveComponent(ownerZoneTag);
            }
            else
            {
                ownerZoneTag.SetOwnerZone(zone);
            }
        }
        else if (zone != null)
        {
            entity.AddComponent(new InsideZoneTag(zone));
        }
    }
示例#4
0
 public InsideZoneTag(CardZoneMaster zone)
 {
     Zone = zone;
 }