public TypeItem(string title, string description, string thumbnailUrl, GadgetType type) { this.title = title; this.description = description; this.thumbnail = thumbnailUrl; this.type = type; }
public SubTypeItem(string title, string description, string url, GadgetSubType type, GadgetType parentType) { this.title = title; this.description = description; this.thumbnail = new BitmapImage(new Uri(url, UriKind.RelativeOrAbsolute)); this.type = type; this.parentType = parentType; }
//+ CLASSIFICATION internal static bool AddToType(GadgetDefinition gadget, GadgetType type) { if (!CLASS_LISTING.ContainsKey(type)) { GuuCore.LOGGER.LogError($"Trying to add gadget {gadget.id} to type {type}, but type listing isn't registered"); return(false); } CLASS_LISTING[type].Add(gadget.id); return(true); }
public CustomLights(IGadget gadget, int Qty, GadgetType gadgettype) : base(gadget) { _qty = Qty; this._gadgetColor = gadget.GadgetColorType; this._widgetColor = gadget.WidgetColorType; this._gadgetPower = gadget.PowerType; this._gadgetType = gadgettype; this._gadgetSize = gadget.GadgetSize; this._serialNumber = gadget.SerialNumber; this._upcNumber = gadget.UpcNumber; }
/// <summary> /// Organizes the gadget by adding it to its list /// </summary> /// <param name="gadget">The gadget to organize</param> /// <param name="type">The type of gadget</param> public virtual void Organize(GadgetDefinition gadget, GadgetType type) { if (!GadgetRegistry.AddToType(gadget, type)) { return; } if (type == GadgetType.FASHION_POD) { Gadget.RegisterFashion(gadget.id); IdentifiableRegistry.RegisterPodForFashion(gadget); } }
public bool HasGadget(GadgetType gadgetType) { bool found = false; for (int i = 0; i < Gadgets.Length && !found; i++) { if (Gadgets[i] != null && Gadgets[i].Type == gadgetType) { found = true; } } return(found); }
/// <summary> /// Registers a new gadget type /// </summary> /// <param name="type">The type to register</param> /// <param name="hashSet">The hash set used for the listings</param> public static void RegisterType(GadgetType type, HashSet <Gadget.Id> hashSet) { if (ModLoader.CurrentStep != LoadingState.PRE_LOAD) { throw new Exception("Handlers need to be registered during 'Pre-Load'"); } if (!CLASS_LISTING.ContainsKey(type)) { Debug.LogError($"The gadget type {type} is already registered"); return; } CLASS_LISTING.Add(type, hashSet); }
public GadgetItem(string id, string title, string description, DateTime createDate, string thumbnailUri, GadgetType type, GadgetSubType subType, string fullName, string creatorName, string creatorWebSite, string creatorLogo) { this.id = id; this.title = title; this.description = description; this.createDate = createDate; this.thumbnail = thumbnailUri; this.type = type; this.subType = subType; this.fullName = fullName; this.creatorName = creatorName; this.creatorWebSite = creatorWebSite; this.creatorLogo = creatorLogo; }
/// <summary> /// Checks if a gadget is from a type /// </summary> /// <param name="id">The id of the gadget to check</param> /// <param name="type">The type of gadget to check for</param> /// <returns>True if it is a valid type, false otherwise</returns> public static bool IsTypeValid(Gadget.Id id, GadgetType type) { return(CLASS_LISTING.ContainsKey(type) && CLASS_LISTING[type].Contains(id)); }
public Gadget(Hashtable hash) : base(hash) { _type = (GadgetType)GetValueFromHash(hash, "_type"); _skillBonus = (SkillType)GetValueFromHash(hash, "_skillBonus", SkillType.NA); }
public Gadget(GadgetType type, SkillType skillBonus, int price, TechLevel minTechLevel, int chance) : base(EquipmentType.Gadget, price, minTechLevel, chance) { _type = type; _skillBonus = skillBonus; }
public VWGadget(GadgetType type) { Type = type; }
public bool HasGadget(GadgetType gadgetType) { bool found = false; for (int i = 0; i < Gadgets.Length && !found; i++) { if (Gadgets[i] != null && Gadgets[i].Type == gadgetType) found = true; } return found; }
public Gadget(string systemName, GadgetType gadgetType) { this.SystemName = systemName; this.GadgetType = gadgetType; }
public Gadget(GadgetType type, SkillType skillBonus, int price, TechLevel minTechLevel, int chance) : base(EquipmentType.Gadget, price, minTechLevel, chance) { _type = type; _skillBonus = skillBonus; }
public Gadget(Hashtable hash) : base(hash) { _type = (GadgetType)GetValueFromHash(hash, "_type"); _skillBonus = (SkillType)GetValueFromHash(hash, "_skillBonus", SkillType.Na); }
public static void SetGadgetType(DependencyObject obj, GadgetType value) { obj.SetValue(GadgetTypeProperty, value); }