public Action(actionEnum type, Handmanager.Handcard hc, Minion ownCardEntity, int place, Minion target, int pen, int choice) { this.actionType = type; this.card = hc; this.own = ownCardEntity; this.place = place; this.target = target; this.penalty = pen; this.druidchoice = choice; }
public Action(Action a) { this.actionType = a.actionType; this.card = a.card; this.place = a.place; this.own = a.own; this.target = a.target; this.druidchoice = a.druidchoice; this.penalty = a.penalty; this.prevHpOwn = a.prevHpOwn; this.prevHpTarget = a.prevHpTarget; }
public Action(actionEnum type, Handmanager.Handcard hc, Minion ownM, int place, Minion targetM, int pen, int choice) { this.actionType = type; this.card = hc; this.own = ownM; this.place = place; this.target = targetM; this.penalty = pen; this.druidchoice = choice; if (ownM != null) { prevHpOwn = ownM.HealthPoints; } if (targetM != null) { prevHpTarget = targetM.HealthPoints; } }
public Action(string s, Playfield p) { if (s.StartsWith("play ")) { this.actionType = actionEnum.playcard; int cardEnt = Convert.ToInt32(s.Split(new string[] { "id " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int targetEnt = -1; if (s.Contains("target ")) { targetEnt = Convert.ToInt32(s.Split(new string[] { "target " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } int place = 0; if (s.Contains("pos ")) { place = Convert.ToInt32(s.Split(new string[] { "pos " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } int choice = 0; if (s.Contains("choice ")) { choice = Convert.ToInt32(s.Split(new string[] { "choice " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); } this.own = null; this.card = new Handmanager.Handcard { entity = cardEnt }; if (targetEnt >= 0) { Minion m = new Minion { entitiyID = targetEnt }; this.target = m; } else { this.target = null; } this.place = place; this.druidchoice = choice; } if (s.StartsWith("attack ")) { this.actionType = actionEnum.attackWithMinion; int ownEnt = Convert.ToInt32(s.Split(' ')[1].Split(' ')[0]); int targetEnt = Convert.ToInt32(s.Split(' ')[3].Split(' ')[0]); this.place = 0; this.druidchoice = 0; this.card = null; Minion m = new Minion { entitiyID = targetEnt }; this.target = m; Minion o = new Minion(); o.entitiyID = ownEnt; this.own = o; } if (s.StartsWith("heroattack ")) { this.actionType = actionEnum.attackWithHero; int targetEnt = Convert.ToInt32(s.Split(' ')[1].Split(' ')[0]); this.place = 0; this.druidchoice = 0; this.card = null; Minion m = new Minion { entitiyID = targetEnt }; this.target = m; this.own = p.ownHero; } if (s.StartsWith("useability on target ")) { this.actionType = actionEnum.useHeroPower; int targetEnt = Convert.ToInt32(s.Split(' ')[3].Split(' ')[0]); this.place = 0; this.druidchoice = 0; this.card = null; Minion m = new Minion { entitiyID = targetEnt }; this.target = m; this.own = null; } if (s == "useability") { this.actionType = actionEnum.useHeroPower; this.place = 0; this.druidchoice = 0; this.card = null; this.own = null; this.target = null; } }
public Action(string s, Playfield p) { if (s.StartsWith("play ")) { this.actionType = actionEnum.playcard; int cardEnt = Convert.ToInt32(s.Split(new string[] { "id " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int targetEnt = -1; if (s.Contains("target ")) targetEnt = Convert.ToInt32(s.Split(new string[] { "target " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int place = 0; if (s.Contains("pos ")) place = Convert.ToInt32(s.Split(new string[] { "pos " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); int choice = 0; if (s.Contains("choice ")) choice = Convert.ToInt32(s.Split(new string[] { "choice " }, StringSplitOptions.RemoveEmptyEntries)[1].Split(' ')[0]); this.own = null; this.card = new Handmanager.Handcard { entity = cardEnt }; if (targetEnt >= 0) { Minion m = new Minion { entitiyID = targetEnt }; this.target = m; } else { this.target = null; } this.place = place; this.druidchoice = choice; } if (s.StartsWith("attack ")) { this.actionType = actionEnum.attackWithMinion; int ownEnt = Convert.ToInt32(s.Split(' ')[1].Split(' ')[0]); int targetEnt = Convert.ToInt32(s.Split(' ')[3].Split(' ')[0]); this.place = 0; this.druidchoice = 0; this.card = null; Minion m = new Minion { entitiyID = targetEnt }; this.target = m; Minion o = new Minion(); o.entitiyID = ownEnt; this.own = o; } if (s.StartsWith("heroattack ")) { this.actionType = actionEnum.attackWithHero; int targetEnt = Convert.ToInt32(s.Split(' ')[1].Split(' ')[0]); this.place = 0; this.druidchoice = 0; this.card = null; Minion m = new Minion { entitiyID = targetEnt }; this.target = m; this.own = p.ownHero; } if (s.StartsWith("useability on target ")) { this.actionType = actionEnum.useHeroPower; int targetEnt = Convert.ToInt32(s.Split(' ')[3].Split(' ')[0]); this.place = 0; this.druidchoice = 0; this.card = null; Minion m = new Minion { entitiyID = targetEnt }; this.target = m; this.own = null; } if (s == "useability") { this.actionType = actionEnum.useHeroPower; this.place = 0; this.druidchoice = 0; this.card = null; this.own = null; this.target = null; } if (s.Contains(" discover ")) { string dc = s.Split(new string[] { " discover " }, StringSplitOptions.RemoveEmptyEntries)[1]; this.tracking = Convert.ToInt32(dc); } }
public Action(Action a) { this.actionType = a.actionType; this.card = a.card; this.place = a.place; this.own = a.own; this.target = a.target; this.druidchoice = a.druidchoice; this.penalty = a.penalty; this.tracking = a.tracking; }