// ---Constructor--- public longPiiig(Point point, string path, Rectangle[] playerBounds, IHand hand, string name, rockSteadyGame form, int length) { this.form = form; this.name = name; this.piiigElements = new List <piiig>(); if (length == 0) { return; } if (length == 1) { piiigElements.Add(new piiig(new Point(point.X, point.Y), path, playerBounds, hand, name, form)); return; } for (int i = 0; i < length; ++i) { if (0 == i) { piiigElements.Add(new piiig(new Point(point.X, point.Y), "favicon (4).ico", playerBounds, hand, "", form)); } else if ((length - 1) == i) { piiigElements.Add(new piiig(new Point(point.X, point.Y), "myFaviconX.png", playerBounds, hand, "", form)); } else { piiigElements.Add(new piiig(new Point(point.X, point.Y), "favicon (1).ico", playerBounds, hand, "", form)); } } }
// ---Constructor--- /// <summary> /// Constructs a Piiig /// </summary> /// <param name="point">Starting Point</param> /// <param name="path">path to file</param> /// <param name="playerBounds">Bounds of the play area</param> /// <param name="hand">the hand object</param> /// <param name="name"></param> /// <param name="form"></param> public piiig(Point point, string path, Rectangle[] playerBounds, IHand hand, string name, rockSteadyGame form) { this.posPoint = point; this.elementImage = Image.FromFile(path); this.playerBorders = playerBounds; this.hand = hand; this.speed = 5; this.name = name; this.form = form; }
static public IPiiig MakePiiig(int longCount, Point point, string path, Rectangle[] playerBounds, IHand hand, rockSteadyGame form, params string[] names) { IPiiig piiigAdd; List <string> newNames = names.ToList(); if (longCount > 0) { piiigAdd = new longPiiig(point, path, playerBounds, hand, newNames[0], form, 10); } else { piiigAdd = new piiig(point, path, playerBounds, hand, newNames[0], form); } if (names.Length == 0) { return(null); } if (names.Length == 1) { return(piiigAdd); } newNames.RemoveAt(0); return(new PiiigHerd(piiigAdd, MakePiiig(--longCount, point, path, playerBounds, hand, form, newNames.ToArray()))); }