public NPCGifts() { NameOfNPC = "Robin"; ItemNames = new ItemNames[] { new ItemNames() }; Mode = "Overwrite"; Priority = 100; }
public ItemViewModel() { ItemNames.Add("No Item"); T equipedItem = GetEquipedItem(); List <T> items = GetItems(); foreach (T item in items) { ItemNames.Add(item.Name); nameToItem.Add(item.Name, item); itemToName.Add(item, item.Name); } if (equipedItem != null) { for (int i = 1; i < ItemNames.Count; i++) { if (equipedItem.Name == ItemNames[i]) { SelectedIndex = i; } } } else { SelectedIndex = 0; } setupFlag = false; }
public override void Init() { base.Init(); if (Count == 0 || Get(0).name != "None") { Insert(0, Condition.Create("None", ConditionalState.None, new Rect())); } for (int i = 0; i < Count; i++) { Condition conditional = Get(i); if (!conditional) { Debug.LogError("The Condition at index '" + i + "' is missing its reference. Removing from ConditionDatabase."); RemoveAt(i); i--; continue; } if (string.IsNullOrEmpty(conditional.name)) { conditional.name = NextItemName("New Condition"); } if (!ItemNames.Contains(conditional.name)) { ItemNames.Add(conditional.name); } conditional.Init(); } }
public static SerializationData Create() { var s = new SerializationData(); s.itemNames = ItemNames.ToArray(); s.actors = Actors.ToArray(); return(s); }
public ActionResult DeleteConfirmed(int id) { ItemNames itemNames = db.itemnames.Find(id); db.itemnames.Remove(itemNames); db.SaveChanges(); return(RedirectToAction("Index")); }
void doItem(ItemNames name) { foreach (var item in items) { item.Value.End(); } items[name].Start(); }
void doItem(ItemNames name) { // もし別のアイテムが実装されていたときに終了させる処理 foreach (var item in items) { item.Value.End(); } items[name].Start(); }
public override IMember GetMember(string name) { var index = ItemNames.IndexOf(n => n == name); if (index >= 0 && index < ItemTypes.Count) { return(new PythonInstance(ItemTypes[index])); } return(base.GetMember(name)); }
public ActionResult Edit([Bind(Include = "ItemNamesID,ItemNameTitle")] ItemNames itemNames) { if (ModelState.IsValid) { db.Entry(itemNames).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(itemNames)); }
public override IMember GetMember(string name) { var index = ItemNames.IndexOf(n => n == name); if (index >= 0 && index < ItemTypes.Count) { return(ItemTypes[index].CreateInstance(ArgumentSet.WithoutContext)); } return(base.GetMember(name)); }
public void LoadItems() { string dataPath = "assets/Data/ItemInfo.json"; ItemsData items = null; try { items = Helper.GetHelper().Data.ReadJsonFile <ItemsData>(dataPath); if (items == null) { Printer.Error($"The {dataPath} file seems to be missing or invalid."); } } catch (Exception ex) { Printer.Error($"The {dataPath} file seems to be missing or invalid.\n{ex}"); } ItemIDNames.Clear(); ItemNames.Clear(); ItemIDs.Clear(); ItemDescriptions.Clear(); var currLang = LocalizedContentManager.CurrentLanguageCode; for (int i = 0; i < items.itemsData.Count; i++) { ItemIDNames.Add(items.itemsData[i].IDName); if (currLang != LocalizedContentManager.LanguageCode.en) { if (items.itemsData[i].NameLocalization.ContainsKey(currLang.ToString()) && items.itemsData[i].NameLocalization[currLang.ToString()].Length > 0) { ItemNames.Add(items.itemsData[i].IDName, items.itemsData[i].NameLocalization[currLang.ToString()]); } else { ItemNames.Add(items.itemsData[i].IDName, items.itemsData[i].Name); } if (items.itemsData[i].DescriptionLocalization.ContainsKey(currLang.ToString()) && items.itemsData[i].DescriptionLocalization[currLang.ToString()].Length > 0) { ItemDescriptions.Add(items.itemsData[i].IDName, items.itemsData[i].DescriptionLocalization[currLang.ToString()]); } else { ItemDescriptions.Add(items.itemsData[i].IDName, items.itemsData[i].Description); } } else { ItemNames.Add(items.itemsData[i].IDName, items.itemsData[i].Name); ItemDescriptions.Add(items.itemsData[i].IDName, items.itemsData[i].Description); } ItemIDs.Add(items.itemsData[i].IDName, items.itemsData[i].ID); } }
public List <SlsBuyerOrderItemBadhon> GetBuyerOrderList(string _BuyerID) { using (_context) { var Data = (from o in _context.SLS_BuyerOrder.AsEnumerable() where o.BuyerID.ToString() == _BuyerID join i in _context.SLS_BuyerOrderItem on o.BuyerOrderID equals i.BuyerOrderID into Items from i in Items.DefaultIfEmpty() join ItemName in _context.Sys_ItemType on(i == null? null: i.ItemTypeID) equals ItemName.ItemTypeID into ItemNames from ItemName in ItemNames.DefaultIfEmpty() join ls in _context.Sys_LeatherStatus on(i == null ? null : i.LeatherStatusID) equals ls.LeatherStatusID into LeatherStatus from ls in LeatherStatus.DefaultIfEmpty() join a in _context.Sys_Article on(i == null ? 0 : i.ArticleID) equals a.ArticleID into Articles from a in Articles.DefaultIfEmpty() join au in _context.Sys_Unit on(i == null ? 0 : i.AvgSizeUnit) equals au.UnitID into AVGUnits from au in AVGUnits.DefaultIfEmpty() join tu in _context.Sys_Unit on(i == null ? 0 : i.ThicknessUnit) equals tu.UnitID into ThickUnits from tu in ThickUnits.DefaultIfEmpty() select new SlsBuyerOrderItemBadhon { BuyerOrderID = o.BuyerOrderID, BuyerOrderNo = o.BuyerOrderNo, BuyerOrderDate = Convert.ToDateTime(o.BuyerOrderDate).ToString("dd'/'MM'/'yyyy"), BuyerOrderItemID = (i == null ? 0 : i.BuyerOrderItemID), ItemTypeID = (i == null ? 0 : i.ItemTypeID), ItemTypeName = (ItemName == null? "": ItemName.ItemTypeName), LeatherStatusID = (i == null ? 0 : i.LeatherStatusID), LeatherStatusName = (ls == null ? "" : ls.LeatherStatusName), ArticleID = (i == null ? 0 : i.ArticleID), ArticleNo = (i == null ? null : i.ArticleNo), ArticleChallanNo = (i == null ? null : i.ArticleChallanNo), ArticleName = (a == null ? null : a.ArticleName), AvgSize = (i == null ? null : i.AvgSize), AvgSizeUnit = (i == null ? 0 : i.AvgSizeUnit), AvgSizeUnitName = (au == null ? "" : au.UnitName), SideDescription = (i == null ? null : i.SideDescription), SelectionRange = (i == null ? null : i.SelectionRange), Thickness = (i == null ? null : i.Thickness), ThicknessUnit = (i == null ? 0 : i.ThicknessUnit), ThicknessUnitName = (tu == null ? "" : tu.UnitName), ThicknessAt = (i == null ? "" : (i.ThicknessAt == "AFSV" ? "After Shaving" : "After Finishing")), }).ToList(); return(Data); } }
public void RemoveInventoryItem(ItemNames toRemove) { foreach (GameObject a in itemsInInventory) { if (a.GetComponentInChildren <InventorItem>().item.itemName == toRemove) { Destroy(a); break; } } }
public ActionResult Create([Bind(Include = "ItemNamesID,ItemNameTitle")] ItemNames itemNames, int?id) { if (ModelState.IsValid) { db.board.Find(id).Items.Add(itemNames); db.itemnames.Add(itemNames); db.SaveChanges(); return(RedirectToAction("Details", "boards", new { id = id })); } return(View(itemNames)); }
public static string AttemptTranslate(ByteArrayStream stream, int depthLeft = 2) { var code = stream.Byte(); if (code >= 0x80) { return(BasicTable.Lookup(code)); } if (code < 0x30) { if (code == 0x01) { return($"{{windowbreak}}"); } if (code == 0x05) { return($"{{05:{stream.Byte().ToString("x2")}}}"); } if (code == 0x1b) { return($"{{swapspeaker:{stream.Byte().ToString("x2")}}}"); } if (code == 0x1d) { return($"{{character:{CharacterNames.GetString(stream.Byte())}}}"); } if (code == 0x1e) { return($"{{item:{ItemNames.GetString(stream.Byte())}}}"); } if (code == 0x1f) { return($"{{location:{LocationNames.GetString(stream.Byte())}}}"); } //if (code == 0x2f) { // return $"{{if:{stream.Byte().ToString("x2")} {stream.Byte().ToString("x2")} {stream.Byte().ToString("x2")}}}"; //} return($"{{{code.ToString("x2")}}}"); } if (depthLeft == 0) { return($"{{{code.ToString("x2")}}}"); } //var text = string.Join("", LookupBytes(code).Select(x => AttemptTranslate(x, depthLeft - 1))); var text = AttemptTranslateLine(LookupBytes(code), depthLeft - 1); return(text); }
// GET: ItemNames/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ItemNames itemNames = db.itemnames.Find(id); if (itemNames == null) { return(HttpNotFound()); } return(View(itemNames)); }
public GUIButton CreateInfoFrame() { int width = 500, height = 400; GUIButton backFrame = new GUIButton(new RectTransform(Vector2.One, GUI.Canvas), style: "GUIBackgroundBlocker"); GUIFrame frame = new GUIFrame(new RectTransform(new Point(width, height), backFrame.RectTransform, Anchor.Center)); GUIFrame paddedFrame = new GUIFrame(new RectTransform(new Vector2(0.9f, 0.9f), frame.RectTransform, Anchor.Center), style: null); new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.1f), paddedFrame.RectTransform), Name, font: GUI.LargeFont); var descriptionBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), paddedFrame.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.15f) }, Description, font: GUI.SmallFont, wrap: true); var skillContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.45f, 0.5f), paddedFrame.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.2f + descriptionBlock.RectTransform.RelativeSize.Y) }); new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), skillContainer.RectTransform), TextManager.Get("Skills"), font: GUI.LargeFont); foreach (SkillPrefab skill in Skills) { new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), skillContainer.RectTransform), " - " + TextManager.AddPunctuation(':', TextManager.Get("SkillName." + skill.Identifier), (int)skill.LevelRange.X + " - " + (int)skill.LevelRange.Y), font: GUI.SmallFont); } var itemContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.45f, 0.5f), paddedFrame.RectTransform, Anchor.TopRight) { RelativeOffset = new Vector2(0.0f, 0.2f + descriptionBlock.RectTransform.RelativeSize.Y) }) { Stretch = true }; new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), itemContainer.RectTransform), TextManager.Get("Items", fallBackTag: "mapentitycategory.equipment"), font: GUI.LargeFont); foreach (string itemName in ItemNames.Distinct()) { int count = ItemNames.Count(i => i == itemName); new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), itemContainer.RectTransform), " - " + (count == 1 ? itemName : itemName + " x" + count), font: GUI.SmallFont); } return(backFrame); }
private static IEnumerable <Item> LoadItemsData() { return (from filename in _reader.GetFileText("itemdata.txt") .Split('\n') .Where(line => !string.IsNullOrEmpty(line)) .Select(fn => fn.Trim()) where _reader.FileExists(filename) select _reader.GetFileText(filename) into filetext from data in filetext.Split('\n') .Where(line => !string.IsNullOrEmpty(line)) .Select(ft => ft.Trim().Split('\t')) select new Item(data, ItemNames.ContainsKey(data[5]) ? ItemNames[data[5]] : "")); }
public override void Init() { base.Init(); bool startNode = false; for (int i = 0; i < Count; i++) { BaseNode node = Get(i); if (!node) { Debug.LogError("The Node at index '" + i + "' is missing its reference. Removing from NodeDatabase."); base.RemoveAt(i); i--; continue; } if (node is StartNode) { if (!startNode) { startNode = true; } else { Debug.LogError(""); base.Remove(node); (node as StartNode).Delete(true); i--; continue; } } if (!ItemNames.Contains(node.name)) { ItemNames.Add(node.name); } node.Init(); } if (!startNode) { base.Add(NodeObject.CreateNew <StartNode> ("StartNode")); } }
public static bool Load(string path, string key) { SilkroadPath = GetSetting("SilkroadPath", path); MediaPk2Key = GetSetting("MediaPk2Key", key); if (string.IsNullOrEmpty(SilkroadPath) || string.IsNullOrEmpty(MediaPk2Key)) { if (!string.IsNullOrEmpty(path) && !string.IsNullOrEmpty(key)) { SilkroadPath = GetSetting("SilkroadPath", path, true); MediaPk2Key = GetSetting("MediaPk2Key", key, true); } else { return(false); } } _reader = new Pk2Reader(SilkroadPath + @"\Media.pk2", MediaPk2Key); var isUpdate = GetSetting("GameVersion", 0); var needUpdate = isUpdate == 0 || isUpdate < Version(); GameVerison = GetSetting("GameVersion", Version(), needUpdate); GatewayPort = ushort.Parse(GetSetting("GatewayPort", GatePort(), needUpdate).ToString()); DivisionServers = DivisionInfo().ToList(); if (!needUpdate) { return(true); } LiteDatabase.DropCollection(Skills.Name); LiteDatabase.DropCollection(Items.Name); LoadTextData(); Skills.Insert(LoadSkillsData().GroupBy(x => x.Id).Select(x => x.OrderBy(y => y.Id).First())); Items.Insert(LoadItemsData().GroupBy(x => x.Id).Select(x => x.OrderBy(y => y.Id).First())); Characters.Insert(LoadCharacterData().GroupBy(x => x.Id).Select(x => x.OrderBy(y => y.Id).First())); ItemNames.Clear(); SkillNames.Clear(); CharacterNames.Clear(); RegionNames.Clear(); GC.Collect(); GC.WaitForPendingFinalizers(); return(true); }
public override int GetHashCode() { unchecked { var hashCode = EnumTypeFullyQualified.GetHashCode(); hashCode = (hashCode * 397) ^ IsValidatable.GetHashCode(); hashCode = (hashCode * 397) ^ HasCreateInvalidImplementation.GetHashCode(); hashCode = (hashCode * 397) ^ IsReferenceType.GetHashCode(); hashCode = (hashCode * 397) ^ IsAbstract.GetHashCode(); hashCode = (hashCode * 397) ^ AttributeInfo.GetHashCode(); hashCode = (hashCode * 397) ^ KeyProperty.GetHashCode(); hashCode = (hashCode * 397) ^ (BaseEnum?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ Settings.GetHashCode(); hashCode = (hashCode * 397) ^ ItemNames.ComputeHashCode(); hashCode = (hashCode * 397) ^ AssignableInstanceFieldsAndProperties.ComputeHashCode(); hashCode = (hashCode * 397) ^ FullyQualifiedDerivedTypes.ComputeHashCode(); return(hashCode); } }
public override void Init() { base.Init(); if (Count == 0) { base.Add(Actor.Create("Default Actor", Color.gray, new Rect(5, 27, CanvasGUI.OptionRect.width - 10, 20))); } if (Get(0).name != "Default Actor") { base.Insert(0, Actor.Create("Default Actor", Color.gray, new Rect(5, 27, CanvasGUI.OptionRect.width - 10, 20))); } for (int i = 0; i < Count; i++) { Actor actor = Get(i); if (!actor) { Debug.LogError("The Actor at index '" + i + "' is missing its reference. Removing from ActorDatabase."); RemoveAt(i); i--; continue; } if (string.IsNullOrEmpty(actor.name)) { actor.name = NextItemName("New Actor"); } if (!ItemNames.Contains(actor.name)) { ItemNames.Add(actor.name); } actor.Init(); } }
public override void Init() { base.Init(); if (!mainNode && !mainNodule) { throw new UnityException(); } else if (mainNode && mainNodule) { throw new UnityException(); } for (int i = 0; i < Count; i++) { BaseNodule nodule = Get(i); if (!nodule) { Debug.LogError("Nodule is null in base node '" + name + "', Removing References."); RemoveAt(i); i--; continue; } if (!ItemNames.Contains(nodule.name)) { ItemNames.Add(nodule.name); } nodule.Init(); } if (Count > 0) { ReCalcAllNodulePos(mainNode, true); } }
public bool Equals(EnumSourceGeneratorState?other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(EnumTypeFullyQualified == other.EnumTypeFullyQualified && IsValidatable == other.IsValidatable && HasCreateInvalidImplementation == other.HasCreateInvalidImplementation && IsReferenceType == other.IsReferenceType && IsAbstract == other.IsAbstract && AttributeInfo.Equals(other.AttributeInfo) && KeyProperty.Equals(other.KeyProperty) && Equals(BaseEnum, other.BaseEnum) && Settings.Equals(other.Settings) && ItemNames.EqualsTo(other.ItemNames) && AssignableInstanceFieldsAndProperties.EqualsTo(other.AssignableInstanceFieldsAndProperties) && FullyQualifiedDerivedTypes.EqualsTo(other.FullyQualifiedDerivedTypes)); }
public bool HasItem(ItemNames name, int count = 1) => HasItem(name, count);
public bool RemoveItem(ItemNames name, int count = 1) => RemoveItem(name, count);
public override IEnumerable <string> GetMemberNames() => ItemNames.Concat(base.GetMemberNames());
public static Item Create(ItemNames name) => Create((int)name);
public ItemAction GetItemAction(ItemNames itemName) { return(itemActions[(int)itemName]); }
void CreateItem(ItemNames _name) { requestedItems.Add(_name.ToString()); GameObject.Find("HUD").GetComponent <HUDCtrl>().UpdateRequestList(); }