Beispiel #1
0
        private static IZoneTracker GetZoneTracker(OwnedZone zone, OpponentCardTracker oppCardTracker)
        {
            switch (zone)
            {
            case OwnedZone.MyLibrary:
                return(new LibraryTracker(zone));

            case OwnedZone.MySideboard:
            case OwnedZone.OppSideboard:
                return(new SideboardTracker(zone));

            case OwnedZone.Unknown:
            case OwnedZone.Battlefield:
            case OwnedZone.Exile:
            case OwnedZone.Stack:
            case OwnedZone.Limbo:
            case OwnedZone.OppGraveyard:
            case OwnedZone.OppCommand:
            case OwnedZone.MyGraveyard:
            case OwnedZone.MyHand:
            case OwnedZone.MyCommand:
            case OwnedZone.Pending:
            case OwnedZone.MyRevealed:
            case OwnedZone.MyPhasedOut:
                return(new SimpleZoneTracker(zone));

            case OwnedZone.OppLibrary:
            case OwnedZone.OppHand:
            case OwnedZone.OppPhasedOut:
                return(new OpponentZoneTracker(zone, oppCardTracker));

            case OwnedZone.OppRevealed:
                return(new OppRevealedTracker(zone, oppCardTracker));

            default:
                throw new ArgumentOutOfRangeException(nameof(zone), zone, null);
            }
        }
Beispiel #2
0
 public OpponentZoneTracker(OwnedZone forZone, OpponentCardTracker cardTracker) : base(forZone)
 {
     this.cardTracker = cardTracker;
     cardTracker.RegisterZone(forZone, () => cards.Select(c => c.InstId));
 }
Beispiel #3
0
 public InGameTrackerState2()
 {
     oppCardTracker = new OpponentCardTracker();
     cardsInZones   = CreateZoneTrackers(oppCardTracker);
     Reset();
 }
Beispiel #4
0
 private static IReadOnlyDictionary <OwnedZone, IZoneTracker> CreateZoneTrackers(OpponentCardTracker oppCardTracker)
 {
     return(EnumExtensions.EveryZone().ToDictionary(z => z, zone => GetZoneTracker(zone, oppCardTracker)));
 }
Beispiel #5
0
 public OppRevealedTracker(OwnedZone forZone, OpponentCardTracker cardTracker) : base(forZone, cardTracker)
 {
 }