public VcRuntimeVersion(Guid productCode, MscVer mscVer, ArchType architecture, string version = "") { ProductCode = productCode; MscVer = mscVer; Architecture = architecture; Version = version; }
public async Task Equip(ArchType archType, [Remainder] string item) { var account = EntityConverter.ConvertUser(Context.User); var inv = account.Inv; if (!inv.HasItem(item)) { await Context.Channel.SendMessageAsync(embed : new EmbedBuilder() .WithColor(Colors.Get("Error")) .WithDescription($":x: You do not have that item.") .Build()); return; } var selectedItem = inv.GetItem(item); if (selectedItem.ExclusiveTo?.Contains(account.Element) ?? true) { if (inv.Equip(item, archType)) { UserAccountProvider.StoreUser(account); _ = ShowInventory(); return; } } await Context.Channel.SendMessageAsync(embed : new EmbedBuilder() .WithColor(Colors.Get("Error")) .WithDescription($":x: {archType}s cannot equip {selectedItem.ItemType}s.") .Build()); }
public Session ToSession(ArchType arch) { var session = new Session(); session.Contexts = frameworks .Select(f => f.ToContext(arch)) .ToArray() ; return(session); }
public unsafe void* Load(string moduleName, string loaderModule, ArchType arch) { var candidate = _archAsPrefix ? arch + "." + moduleName + ".dll" : moduleName + "." + arch + ".dll"; if (!_rsc.ContainsKey(candidate)) return null; var dllStream = _asm.GetManifestResourceStream(candidate); var memory = new byte[dllStream.Length]; dllStream.Read(memory, 0, (int) dllStream.Length); var gch = GCHandle.Alloc(memory, GCHandleType.Pinned); _loadedResources[(ulong) gch.AddrOfPinnedObject().ToPointer()] = gch; return (void *) gch.AddrOfPinnedObject().ToPointer(); }
public bool Equip(string item, ArchType archType) { if (!HasItem(item)) { return(false); } var i = Inv.Where(s => s.Name.Equals(item, StringComparison.InvariantCultureIgnoreCase)).First(); if (!i.IsEquippable) { return(false); } var Gear = WarriorGear; if (archType == ArchType.Mage) { if (WarriorExclusive.Contains(i.ItemType)) { return(false); } Gear = MageGear; } else { if (MageExclusive.Contains(i.ItemType)) { return(false); } } Item g; g = Gear.GetItem(i.Category); if (g != null) { if (g.IsCursed) { return(false); } else { Gear.Remove(g); } } Gear.Add(i); UpdateStrings(); return(true); }
public string GearToString(ArchType archType, bool detailed = false) { var s = new StringBuilder(); var Gear = GetGear(archType); var DefaultIcons = archType == ArchType.Warrior ? WarriorIcons : MageIcons; foreach (ItemCategory cat in Item.Equippables) { s.Append(Gear.GetItem(cat)?.IconDisplay ?? DefaultIcons[cat]); } return(s.ToString()); }
public async Task Equip(ArchType archType, [Remainder] string item) { var account = UserAccounts.GetAccount(Context.User); var inv = account.Inv; var selectedItem = ItemDatabase.GetItem(item); if (selectedItem.ExclusiveTo == null || (selectedItem.ExclusiveTo != null && selectedItem.ExclusiveTo.Contains(account.Element))) { if (inv.Equip(item, archType)) { _ = ShowInventory(); } } await Task.CompletedTask; }
public unsafe void *Load(string moduleName, string loaderModule, ArchType arch) { var candidate = _archAsPrefix ? arch + "." + moduleName + ".dll" : moduleName + "." + arch + ".dll"; if (!_rsc.ContainsKey(candidate)) { return(null); } var dllStream = _asm.GetManifestResourceStream(candidate); var memory = new byte[dllStream.Length]; dllStream.Read(memory, 0, (int)dllStream.Length); var gch = GCHandle.Alloc(memory, GCHandleType.Pinned); _loadedResources[(ulong)gch.AddrOfPinnedObject().ToPointer()] = gch; return((void *)gch.AddrOfPinnedObject().ToPointer()); }
public async Task Equip(ArchType archType, [Remainder] string item) { var account = UserAccounts.GetAccount(Context.User); var inv = account.Inv; var selectedItem = ItemDatabase.GetItem(item); if (selectedItem.Name.Contains("NOT IMPLEMENTED")) { var emb = new EmbedBuilder(); emb.WithDescription(":x: I asked our treasurer, the weapon smith, the priest, the librarian and a cool looking kid walking by, and no one has heard of that item!"); emb.WithColor(Colors.Get("Error")); await Context.Channel.SendMessageAsync("", false, emb.Build()); return; } if (!inv.HasItem(selectedItem.Name)) { await Context.Channel.SendMessageAsync(embed : new EmbedBuilder() .WithColor(Colors.Get("Error")) .WithDescription($":x: You do not have that item.") .Build()); return; } if (selectedItem.ExclusiveTo == null || (selectedItem.ExclusiveTo != null && selectedItem.ExclusiveTo.Contains(account.Element))) { if (inv.Equip(item, archType)) { _ = ShowInventory(); return; } } await Context.Channel.SendMessageAsync(embed : new EmbedBuilder() .WithColor(Colors.Get("Error")) .WithDescription($":x: {archType}s cannot equip {selectedItem.ItemType}s.") .Build()); }
/// <summary>Provides the canonical Architecture form for a given architecture sub architecture pair</summary> /// <param name="archType">Architecture type</param> /// <param name="subArch">Sub Architecture type</param> /// <returns>Canonical <see cref="ArchType"/></returns> /// <remarks> /// Some architectures, particularly ARM variants, have multiple sub-architecture types that /// have a canonical form (i.e. Arch=<see cref="ArchType.Arm"/>; SubArch=<see cref="SubArchType.ARMSubArch_v7m"/>; /// has the Canonical Arch of <see cref="ArchType.Thumb"/>). This method retrieves the canonical Arch /// for a given architecture,SubArchitecture pair. /// </remarks> public static ArchType GetCanonicalArchForSubArch(ArchType archType, SubArchType subArch) { archType.ValidateDefined(nameof(archType)); subArch.ValidateDefined(nameof(subArch)); switch (archType) { case ArchType.Kalimba: switch (subArch) { case SubArchType.NoSubArch: case SubArchType.KalimbaSubArch_v3: case SubArchType.KalimbaSubArch_v4: case SubArchType.KalimbaSubArch_v5: return(ArchType.Kalimba); default: return(ArchType.UnknownArch); } case ArchType.Arm: case ArchType.Armeb: switch (subArch) { case SubArchType.ARMSubArch_v6m: return(archType == ArchType.Armeb ? ArchType.Thumbeb : ArchType.Thumb); case SubArchType.KalimbaSubArch_v3: case SubArchType.KalimbaSubArch_v4: case SubArchType.KalimbaSubArch_v5: return(ArchType.UnknownArch); default: return(archType); } default: return(archType); } }
public ES.Context ToContext(ArchType arch) { var ctx = new ES.Context { Name = Name, Version = Version }; ctx.Addins = Addins .Where(ai => !(ai is XLL xll && xll.Arch != arch)) .Select(ai => new ES.Addin { Path = ai.Path, ReadOnly = ai.ReadOnly }) .ToArray() ; ctx.Params = Boxes .SelectMany(b => b.Controls) .Select(c => c.ToParam()) .Where(p => p != null) .ToArray() ; return(ctx); }
public Pool(ArchType arch) { this.pooledArchType = arch; this.pooledProjectiles = new Stack <PooledType>(); }
public static ObjectFormatType GetDefaultObjectFormat(ArchType arch, OSType os) { arch.ValidateDefined(nameof(arch)); os.ValidateDefined(nameof(os)); switch (arch) { case ArchType.UnknownArch: case ArchType.Aarch64: case ArchType.Arm: case ArchType.Thumb: case ArchType.X86: case ArchType.Amd64: if (IsOsDarwin(os)) { return(ObjectFormatType.MachO); } if (os == OSType.Win32) { return(ObjectFormatType.COFF); } return(ObjectFormatType.ELF); case ArchType.Aarch64BE: case ArchType.AMDGCN: case ArchType.Amdil: case ArchType.Amdil64: case ArchType.Armeb: case ArchType.Avr: case ArchType.BPFeb: case ArchType.BPFel: case ArchType.Hexagon: case ArchType.Lanai: case ArchType.Hsail: case ArchType.Hsail64: case ArchType.Kalimba: case ArchType.Le32: case ArchType.Le64: case ArchType.MIPS: case ArchType.MIPS64: case ArchType.MIPS64el: case ArchType.MIPSel: case ArchType.MSP430: case ArchType.Nvptx: case ArchType.Nvptx64: case ArchType.PPC64le: case ArchType.R600: case ArchType.Renderscript32: case ArchType.Renderscript64: case ArchType.Shave: case ArchType.Sparc: case ArchType.Sparcel: case ArchType.Sparcv9: case ArchType.Spir: case ArchType.Spir64: case ArchType.SystemZ: case ArchType.TCE: case ArchType.Thumbeb: case ArchType.Wasm32: case ArchType.Wasm64: case ArchType.Xcore: return(ObjectFormatType.ELF); case ArchType.PPC: case ArchType.PPC64: if (IsOsDarwin(os)) { return(ObjectFormatType.MachO); } return(ObjectFormatType.ELF); default: throw new ArgumentException(Resources.Unsupported_Architecture, nameof(arch)); } }
/// <summary>Retrieves the canonical name for an architecture type</summary> /// <param name="archType">Architecture type</param> /// <returns>String name for the architecture</returns> /// <overloads> /// Many parts of a triple can take a variety of literal string /// forms to allow for common real world triples when parsing. /// The GetCanonicalName methods provide the canonical form of /// such triple components used in a normalized triple. /// </overloads> public static string GetCanonicalName(ArchType archType) => LibLLVMTripleGetArchTypeName(( LibLLVMTripleArchType )archType) ?? string.Empty;
public CharSheet(int level, String race, String type) { InitializeComponent(); Level = level; Type = type; Race = new RaceTemplate(race); Job = new ArchType(type, level); // invoke racial specials racials(); ldefenses = new int[4]; lstats = new int[6]; lstatsMod = new int[6]; racialAbilities = new List <string>(); jobAbilities = new List <string>(); racialSpecials = new List <string>(); jobSpecials = new List <string>(); skills = ""; foreach (string language in Race.Languages) { languages += language + ", "; } foreach (String skill in Job.ArchTypeSkills) { skills += skill + ", "; } foreach (String skill in Race.RacialSkills) { if (!skills.Contains(skill)) { skills += skill + ", "; } } for (int i = 0; i < lstats.Length; i++) { lstats[i] = Job.Stats[i] + Race.Stats[i]; if (lstats[i] < 10) { lstatsMod[i] = (lstats[i] - 11) / 2; } else { lstatsMod[i] = (lstats[i] - 10) / 2; } } for (int i = 0; i < ldefenses.Length; i++) { ldefenses[i] = Job.Defenses[i]; } if (lightArmor.Contains(Job.armor)) { if (lstatsMod[2] > lstatsMod[3]) { ldefenses[0] = ldefenses[0] + lstatsMod[2]; } else { ldefenses[0] = ldefenses[0] + lstatsMod[3]; } } if (lstatsMod[0] > lstatsMod[1]) { ldefenses[1] = ldefenses[1] + lstatsMod[0]; } else { ldefenses[1] = ldefenses[1] + lstatsMod[1]; } if (lstatsMod[2] > lstatsMod[3]) { ldefenses[2] = ldefenses[2] + lstatsMod[2]; } else { ldefenses[2] = ldefenses[2] + lstatsMod[3]; } if (lstatsMod[4] > lstatsMod[5]) { ldefenses[3] = ldefenses[3] + lstatsMod[4]; } else { ldefenses[3] = ldefenses[3] + lstatsMod[5]; } hp = Job.HP + lstats[1]; numSurge = Job.HealingSurges + lstatsMod[1]; String abilities = ""; foreach (String ability in Job.ArchTypeAbilities) { abilities += ability + "\n\n"; } foreach (String ability in Race.RacialAbilities) { abilities += ability + "\n\n"; } String specials = ""; foreach (String special in Job.ArchTypeSpecial) { specials += "-" + special + "\n"; } foreach (String special in Race.RacialSpecial) { specials += "-" + special + "\n"; } if (prof3Weapons.Contains(Job.mainHand)) { weaponProf = 4 + ((Level - 1) / 5); } else { weaponProf = 3 + ((Level - 1) / 5); } abilities = abilities.Replace("`STRMOD`", lstatsMod[0].ToString()); abilities = abilities.Replace("`CONMOD`", lstatsMod[1].ToString()); abilities = abilities.Replace("`DEXMOD`", lstatsMod[2].ToString()); abilities = abilities.Replace("`INTMOD`", lstatsMod[3].ToString()); abilities = abilities.Replace("`WISMOD`", lstatsMod[4].ToString()); abilities = abilities.Replace("`CHAMOD`", lstatsMod[5].ToString()); abilities = abilities.Replace("`HALFLEVEL`", (Level / 2).ToString()); specials = specials.Replace("`STRMOD`", lstatsMod[0].ToString()); specials = specials.Replace("`CONMOD`", lstatsMod[1].ToString()); specials = specials.Replace("`DEXMOD`", lstatsMod[2].ToString()); specials = specials.Replace("`INTMOD`", lstatsMod[3].ToString()); specials = specials.Replace("`WISMOD`", lstatsMod[4].ToString()); specials = specials.Replace("`CHAMOD`", lstatsMod[5].ToString()); specials = specials.Replace("`HALFLEVEL`", (Level / 2).ToString()); abilities = abilities.Replace("`STRWEA`", (lstatsMod[0] + weaponProf).ToString()); abilities = abilities.Replace("`CONWEA`", (lstatsMod[1] + weaponProf).ToString()); abilities = abilities.Replace("`DEXWEA`", (lstatsMod[2] + weaponProf).ToString()); abilities = abilities.Replace("`INTWEA`", (lstatsMod[3] + weaponProf).ToString()); abilities = abilities.Replace("`WISWEA`", (lstatsMod[4] + weaponProf).ToString()); abilities = abilities.Replace("`CHAWEA`", (lstatsMod[5] + weaponProf).ToString()); specials = specials.Replace("`STRWEA`", (lstatsMod[0] + weaponProf).ToString()); specials = specials.Replace("`CONWEA`", (lstatsMod[1] + weaponProf).ToString()); specials = specials.Replace("`DEXWEA`", (lstatsMod[2] + weaponProf).ToString()); specials = specials.Replace("`INTWEA`", (lstatsMod[3] + weaponProf).ToString()); specials = specials.Replace("`WISWEA`", (lstatsMod[4] + weaponProf).ToString()); specials = specials.Replace("`CHAWEA`", (lstatsMod[5] + weaponProf).ToString()); abilities = abilities.Replace("`STRIMP`", (lstatsMod[0] + 1 + ((Level - 1) / 5)).ToString()); abilities = abilities.Replace("`CONIMP`", (lstatsMod[1] + 1 + ((Level - 1) / 5)).ToString()); abilities = abilities.Replace("`DEXIMP`", (lstatsMod[2] + 1 + ((Level - 1) / 5)).ToString()); abilities = abilities.Replace("`INTIMP`", (lstatsMod[3] + 1 + ((Level - 1) / 5)).ToString()); abilities = abilities.Replace("`WISIMP`", (lstatsMod[4] + 1 + ((Level - 1) / 5)).ToString()); abilities = abilities.Replace("`CHAIMP`", (lstatsMod[5] + 1 + ((Level - 1) / 5)).ToString()); specials = specials.Replace("`STRIMP`", (lstatsMod[0] + 1 + ((Level - 1) / 5)).ToString()); specials = specials.Replace("`CONIMP`", (lstatsMod[1] + 1 + ((Level - 1) / 5)).ToString()); specials = specials.Replace("`DEXIMP`", (lstatsMod[2] + 1 + ((Level - 1) / 5)).ToString()); specials = specials.Replace("`INTIMP`", (lstatsMod[3] + 1 + ((Level - 1) / 5)).ToString()); specials = specials.Replace("`WISIMP`", (lstatsMod[4] + 1 + ((Level - 1) / 5)).ToString()); specials = specials.Replace("`CHAIMP`", (lstatsMod[5] + 1 + ((Level - 1) / 5)).ToString()); labelLanguageValue.Content = languages; labelSizevalue.Content = Race.Size; labelName.Content = " "; labelClass.Content = Job.Name; labelLevel.Content = "Level " + Level; labelRace.Content = Race.Name; labelSpeedValue.Content = Race.Speed + Job.Speed; labelInitiativeValue.Content = lstatsMod[2]; labelHpValue.Content = hp; labelBloodiedValue.Content = hp / 2; labelSurgeNumValue.Content = numSurge; labelSurgeValue.Content = hp / 4; labelStrValue.Content = lstats[0]; labelConValue.Content = lstats[1]; labelDexValue.Content = lstats[2]; labelIntValue.Content = lstats[3]; labelWisValue.Content = lstats[4]; labelChaValue.Content = lstats[5]; labelStrModValue.Content = "(+" + lstatsMod[0] + ")"; labelConModValue.Content = "(+" + lstatsMod[1] + ")"; labelDexModValue.Content = "(+" + lstatsMod[2] + ")"; labelIntModValue.Content = "(+" + lstatsMod[3] + ")"; labelWisModValue.Content = "(+" + lstatsMod[4] + ")"; labelChaModValue.Content = "(+" + lstatsMod[5] + ")"; labelSkillsValue.Content = skills; labelAbilities.Content = abilities; labelSpecialsValue.Content = specials; labelACValue.Content = (ldefenses[0] + 11 + (Level / 2) + ((Level - 1) / 5)).ToString(); labelFortValue.Content = (ldefenses[1] + 10 + (Level / 2)).ToString(); labelRefValue.Content = (ldefenses[2] + 10 + (Level / 2)).ToString(); labelWillValue.Content = (ldefenses[3] + 10 + (Level / 2)).ToString(); labelArmorValue.Content = Job.armor; labelMainHandValue.Content = Job.mainHand; labelOffHandValue.Content = Job.offHand; labelImplementValue.Content = Job.implement; labelRangedWeaponValue.Content = Job.ranged; } // end constructor
public List <Item> GetGear(ArchType arch) { return(arch == ArchType.Warrior ? WarriorGear : MageGear); }
public PlatformInfo(ArchType archtype) { _arch = archtype; }
public PlatformInfo() { _arch = ArchType.Empty; }