public MTG(params List <MTGObject.BaseCardAttributes>[] libraries) { instance = this; int playerIndex = 0; foreach (var library in libraries) { Player player = new Player(); foreach (var i in library) { var cardattr = i; cardattr.owner = playerIndex; MTGObject mtgObject = new MTGObject(cardattr); OID oid = CreateObject(mtgObject); player.library.Add(oid); } players.Add(player); playerIndex++; } }
public void ResolveTop() { MTG mtg = MTG.Instance; OID oid = Get(0); MTGObject obj = mtg.objects[oid]; obj.Resolve(); if (obj is AbilityObject) { mtg.DeleteObject(oid); } else { if (obj.CanBePermanent) { mtg.MoveZone(oid, this, mtg.battlefield); } else { mtg.MoveZone(oid, this, mtg.players[obj.owner].graveyard); } } }
protected static bool ControllerCondition(OID oid) { MTG mtg = MTG.Instance; return(mtg.objects[oid].attr.controller == mtg.turn.playerPriorityIndex); }
protected static bool BattlefieldCondition(OID oid) { MTG mtg = MTG.Instance; return(mtg.FindZoneFromOID(oid) == mtg.battlefield); }