public ConvergeSelector_Zone(JSONArray template) { whose = ConvergeSelector.New(template.getProperty(1)); zoneId = (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), template.getString(2)); filters = new List <ConvergeSelector>(); for (int Idx = 3; Idx < template.Length; ++Idx) { filters.Add(ConvergeSelector.New(template.getProperty(Idx))); } }
public ConvergeZone(JSONTable template, ConvergePlayer owner, ConvergeZoneId zoneId) { this.owner = owner; this.zoneId = zoneId; this.basePos = template.getVector2("basePos"); this.slotOffset = template.getVector2("slotOffset"); this.inPlay = template.getBool("inPlay", false); this.isHidden = template.getBool("isHidden", false); Vector2 topLeft = template.getVector2("topLeft"); Vector2 bottomRight = template.getVector2("bottomRight"); bounds = new Rectangle(topLeft.ToPoint(), (bottomRight - topLeft).ToPoint()); }
public ConvergeActivatedAbilitySpec(JSONTable template, ContentManager Content) { frame = Content.Load <Texture2D>(template.getString("frame", "abilityFrame")); icon = Content.Load <Texture2D>(template.getString("icon")); text = template.getString("text", "").InsertLineBreaks(Game1.font, ConvergeUIAbility.AbilityTooltipWidth - 15); textHeight = (int)Game1.font.MeasureString(text).Y; effect = ConvergeCommand.New(template.getArray("effect"), Content); frameColor = template.getString("frameColor", "FFFFFF").toColor(); if (template.hasKey("attackEffect")) { attackEffect = ConvergeCommand.New(template.getArray("attackEffect"), Content); } if (template.hasKey("target")) { target = ConvergeSelector.New(template.getProperty("target")); } manacost = new ConvergeManaAmount(template.getString("manaCost", "")); uses = template.getInt("uses", 0); altCost = 0; foreach (string altcostString in template.getArray("altCost", JSONArray.empty).asStrings()) { altCost |= (ConvergeAltCost)Enum.Parse(typeof(ConvergeAltCost), altcostString); } JSONArray zoneTemplate = template.getArray("activeZones", null); if (zoneTemplate == null) { activeZones = ConvergeZoneId.Attack | ConvergeZoneId.Defense | ConvergeZoneId.Home; } else { activeZones = 0; foreach (string zoneName in zoneTemplate.asStrings()) { activeZones |= (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), zoneName); } } }
public ConvergeCommand_Spawn(JSONArray template, ContentManager Content) { players = ConvergeSelector.New(template.getProperty(1)); cardSpec = ConvergeCardSpec.allCards[template.getString(2)]; zoneId = (ConvergeZoneId)Enum.Parse(typeof(ConvergeZoneId), template.getString(3, "Defense")); }
public ConvergeZone GetZone(ConvergeZoneId zoneId) { return(zones[zoneId]); }