public DotData(string ht, DLCType dt, OnType ot, string position) { this.position = position; type = ht; dtype = dt.ToString(); otype = ot.ToString(); }
public void setOType(OnType ot) { foreach (Transform child in go.transform) { if (child.name == ot.ToString().ToLower()) { child.gameObject.SetActive(true); } else if (child.name == this.ot.ToString().ToLower()) { child.gameObject.SetActive(false); } } this.oi = (int)ot; this.ot = ot; }
public static Bitmap getImage(OnType ot) { ResourceManager rm = Resources.ResourceManager; try { Bitmap b = (Bitmap)rm.GetObject(getName(ot.ToString())); if (b != null) { return(b); } } catch (Exception e) { } return(null); }
public LevelData getLevel() { List <DotData> dots = new List <DotData>(); foreach (Dot d in Form1.dots.Values) { if (d.getHType() == HeroType.RANDOM && ((!Form1.ons.ContainsKey(d)) || (ons[d].getOType() == OnType.NONE))) { continue; } OnType ot; if (Form1.ons.ContainsKey(d)) { ot = Form1.ons[d].getOType(); } else { ot = OnType.NONE; } if (d.getHType() == HeroType.RANDOM) { dots.Add(new DotData("NONE", d.getDType(), ot, d.getX() + ":" + d.getY())); } else { dots.Add(new DotData(d.getHType().ToString(), d.getDType(), ot, d.getX() + ":" + d.getY())); } } Dictionary <HeroType, TargetData> targets = new Dictionary <HeroType, TargetData>(); Dictionary <OnType, TargetData> targets2 = new Dictionary <OnType, TargetData>(); foreach (DataGridViewRow row in instance.targetsData.Rows) { if (hts.ContainsKey((string)row.Cells["type"].Value)) { Console.WriteLine("1"); HeroType ht = hts[(string)row.Cells["type"].Value]; int i = Decimal.ToInt32((decimal)row.Cells["number"].Value); targets.Add(ht, new TargetData(ht.ToString(), "", 1)); } else if (ots.ContainsKey((string)row.Cells["type"].Value)) { Console.WriteLine("2"); OnType ot = ots[(string)row.Cells["type"].Value]; targets2.Add(ot, new TargetData("", ot.ToString(), Decimal.ToInt32((decimal)row.Cells["number"].Value))); } } List <TargetData> list = new List <TargetData>(); list.AddRange(targets.Values); list.AddRange(targets2.Values); return(new LevelData(dots, list.ToList(), (int)stepsBox.Value, (int)energyBox.Value)); }