public void ParseParticipateRewards(XmlNode node) { int i = 0; foreach (XmlNode itemNode in node.SelectNodes("item")) { if (i >= 3) { return; } if (itemNode.Attributes.Count == 0) // No present for this tier { i++; continue; } PresentType type = (PresentType)int.Parse(itemNode.Attributes["category_id"].Value); switch (type) { case Entities.PresentType.CAR: ParticipatePresents[i] = EventPresent.FromCar(itemNode.Attributes["f_name"].Value); break; case Entities.PresentType.PAINT: ParticipatePresents[i] = EventPresent.FromPaint(int.Parse(itemNode.Attributes["argument1"].Value)); break; } i++; } }
public static EventPresent FromSuit(int suitID) { var present = new EventPresent(); present.PresentType = PresentType.SUIT; present.SuitID = suitID; return(present); }
public static EventPresent FromPaint(int paintID) { var present = new EventPresent(); present.PresentType = PresentType.PAINT; present.PaintID = paintID; return(present); }
public static EventPresent FromCar(string carLabel) { var present = new EventPresent(); present.PresentType = PresentType.CAR; present.CarLabel = carLabel; return(present); }
public void SetParticipatePresent(int index, EventPresent present) => ParticipatePresents[index] = present;
public void SetRewardPresent(int index, EventPresent present) => RewardPresents[index] = present;