/// <summary> /// Sort comparsion is by Required level (desc), BaseName (asc) /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(object other) { PoeItem cmp = other as PoeItem; //int[] comparsions = { Name.CompareTo(cmp.Name), TypeLine.CompareTo(cmp.TypeLine), Owner.CompareTo(cmp.Owner) }; //for (int x = 0; x < comparsions.Length; x++) // if (comparsions[x] != 0) // return comparsions[x]; //return 0; //sorting gems by typename if (FrameType == FrameTypeIndex.Gem) { return(TypeLine.CompareTo(cmp.TypeLine)); } //sorting belts by typename if (ClassCat == ClassIndex.Misc && SlotCat == 9) { return(TypeLine.CompareTo(cmp.TypeLine)); } if (MinLevelRequired > cmp.MinLevelRequired) { return(-1); } if (MinLevelRequired == cmp.MinLevelRequired) { return(TypeLine.CompareTo(cmp.TypeLine)); } else { return(1); } }
public ItemLineInfo(Vector2 point, TypeLine typeLine) { this.point = point; this.point.x = MathfExtension.FloorToIntAbs(point.x); this.point.y = MathfExtension.FloorToIntAbs(point.y); this.typeLine = typeLine; }
private ScarabRank GetScarabRank() { ScarabRank result = ScarabRank.Unknown; Enum.TryParse(TypeLine.Split(' ')[0], true, out result); return(result); }
private ScarabEffect GetScarabEffect() { ScarabEffect result = ScarabEffect.Unknown; Enum.TryParse(TypeLine.Split(' ')[1], true, out result); return(result); }
private Material ReaderMaterial(StreamReader obj) { TypeLine tp = TypeLine.OTHER; while (tp == TypeLine.OTHER) { dataLine = ReaderLine(obj); tp = this.GetTypeLine(dataLine[0]); } return(new Material()); }
public static void Push(object arg, TypeLine typeLine = TypeLine.NewLine) { switch (typeLine) { case TypeLine.Default: Console.Write($"[{DateTime.Now}]: {arg}"); break; case TypeLine.NewLine: Console.WriteLine($"[{DateTime.Now}]: {arg}"); break; } }
public static void Push(string message, TypeLine typeLine = TypeLine.NewLine) { switch (typeLine) { case TypeLine.Default: Console.Write($"[{DateTime.Now}]: {message}"); break; case TypeLine.NewLine: Console.WriteLine($"[{DateTime.Now}]: {message}"); break; } }
public override int GetHashCode() { var hash = 3; hash = 53 * hash + (Name?.GetHashCode() ?? 0); hash = 53 * hash + (TypeLine?.GetHashCode() ?? 0); hash = 53 * hash + (Variation?.GetHashCode() ?? 0); hash = 53 * hash + (Links.GetHashCode()); hash = 53 * hash + (GemLevel.GetHashCode()); hash = 53 * hash + (GemQuality.GetHashCode()); hash = 53 * hash + (MapTier.GetHashCode()); hash = 53 * hash + (GemCorrupted.GetHashCode()); hash = 53 * hash + FrameType; return(hash); }
/// <summary> /// Adicionar linhas /// </summary> /// <param name="fromX">Posição de X</param> /// <param name="fromY">Posição de Y</param> /// <param name="toX">Posição para X</param> /// <param name="toY">Posição para Y</param> /// <param name="line">Tipo de linha</param> /// <param name="phase">Estagio de espaço quando for utilizar a linha pontilhada</param> public void AddLine(double fromX, double fromY, double toX, double toY, TypeLine line, double phase) { var from = CalculateFromTO(fromX, fromY); var to = CalculateFromTO(toX, toY); if (line == TypeLine.DottedLine) { contentByte.SetLineDash(4f, phase); } else { contentByte.SetLineDash(1); } contentByte.MoveTo(from.Item1, from.Item2); contentByte.LineTo(to.Item1, to.Item2); contentByte.Stroke(); }
public Group ReaderGroup(StreamReader obj, bool addName) { List <Face> lstFaces = new List <Face>(); Material material = null; string name = string.Empty; if (addName) { name = dataLine[1].Trim(); dataLine = this.ReaderLine(obj); } TypeLine type = this.GetTypeLine(dataLine[0]); while (type != TypeLine.OTHER && type != TypeLine.GROUP) { switch (type) { case TypeLine.VERTEX: lstVertices.Add(this.ReadVertex(dataLine)); break; case TypeLine.VERTEX_NORMAL: lstVertices.Add(this.ReadVertex(dataLine)); break; case TypeLine.VERTEX_TEXTURE: lstTextureVertices.Add(this.ReadVertex(dataLine)); break; case TypeLine.FACE: lstFaces.Add(this.ReadFace(dataLine, lstVertices)); break; } if (type == TypeLine.OTHER) { break; } dataLine = this.ReaderLine(obj); type = this.GetTypeLine(dataLine[0]); } return(this.BuilderGroup(name, lstFaces, lstNormalVertices, lstTextureVertices, material)); }
public ResponseObj Reader(StreamReader obj) { ResponseObj ret = new ResponseObj(); ret.Groups = new List <Group>(); ret.Materials = new MaterialList(); lstVertices = new List <Vector3f>(); lstNormalVertices = new List <Vector3f>(); lstTextureVertices = new List <Vector3f>(); dataLine = this.ReaderLine(obj); while (!obj.EndOfStream) { TypeLine tp = this.GetTypeLine(dataLine[0]); switch (tp) { case TypeLine.GROUP: ret.Groups.Add(this.ReaderGroup(obj, true)); break; case TypeLine.VERTEX: case TypeLine.VERTEX_NORMAL: case TypeLine.VERTEX_TEXTURE: case TypeLine.FACE: ret.Groups.Add(this.ReaderGroup(obj, false)); break; case TypeLine.OTHER: ret.Materials.Add(this.ReaderMaterial(obj)); break; default: dataLine = this.ReaderLine(obj); break; } } lstVertices.Clear(); lstNormalVertices.Clear(); lstTextureVertices.Clear(); return(ret); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (typeof(Key) != obj.GetType()) { return(false); } var other = (Key)obj; if (FrameType != other.FrameType) { return(false); } if (!Name?.Equals(other.Name) ?? (other.Name != null)) { return(false); } if (!TypeLine?.Equals(other.TypeLine) ?? (other.TypeLine != null)) { return(false); } if (!Variation?.Equals(other.Variation) ?? (other.Variation != null)) { return(false); } if (!Links?.Equals(other.Links) ?? (other.Links != null)) { return(false); } if (!GemLevel?.Equals(other.GemLevel) ?? (other.GemLevel != null)) { return(false); } if (!GemQuality?.Equals(other.GemQuality) ?? (other.GemQuality != null)) { return(false); } if (!MapTier?.Equals(other.MapTier) ?? (other.MapTier != null)) { return(false); } if (!GemCorrupted?.Equals(other.GemCorrupted) ?? (other.GemCorrupted != null)) { return(false); } return(true); }
private int FindSlotCat() { if (ClassCat == ClassIndex.Misc) { if (FrameType == FrameTypeIndex.Unique) { return(14); } if (TypeLine.EndsWith("Belt") || TypeLine == "Rustic Sash") { return(9); } else if (TypeLine.EndsWith("Ring")) { return(8); } else if (TypeLine.EndsWith("Amulet")) { return(7); } //else //{ // ItemsCategoryTable.CatSubCat cat = ItemsCategoryTable.Find(this); // return cat.SlotIndex; //} } else if (ClassCat == ClassIndex.Marauder) { if (ItemProperties.Count > 0) { if (ItemProperties[0].Name == "One Handed Mace") { return(0); } if (ItemProperties[0].Name == "Two Handed Mace") { return(1); } if (ItemProperties[0].Name == "One Handed Axe") { return(2); } } if (TypeLine.EndsWith("Greaves")) { return(3); } if (TypeLine.EndsWith("late")) { return(4); } if (TypeLine.EndsWith("Casque")) { return(5); } if (TypeLine.EndsWith("Gauntlets")) { return(6); } if (TypeLine.EndsWith("Shield")) { return(7); } return(8); } else if (ClassCat == ClassIndex.Ranger) { if (ItemProperties.Count > 0) { if (ItemProperties[0].Name == "Bow") { return(0); } if (ItemProperties[0].Name == "One Handed Sword") { return(1); } } if (TypeLine.EndsWith("Quiver")) { return(2); } if (TypeLine.EndsWith("Boots")) //Boots { return(3); } if (TypeLine.EndsWith("Leather") || TypeLine.EndsWith("Tunic") || TypeLine.EndsWith("Garb") || TypeLine.EndsWith("Jerkin")) //Chest { return(4); } if (TypeLine.EndsWith("Hood") || TypeLine.EndsWith("Cap")) //Helment { return(5); } if (TypeLine.EndsWith("Gloves")) //Gloves { return(6); } if (TypeLine.EndsWith("Buckler")) //Shield { return(7); } return(8); } else if (ClassCat == ClassIndex.Witch) { //private static string[] PoeItemWitchCatNames = { "Wand", "Boots", "Chest", "Helment", "Gloves", "Shield", "Unknown" }; if (ItemProperties.Count > 0) { if (ItemProperties[0].Name == "Wand") { return(0); } } if (TypeLine.EndsWith("Boots") || TypeLine.EndsWith("Slippers") || TypeLine.EndsWith("Shoes")) { return(1); } if (TypeLine.EndsWith("Robe") || TypeLine.EndsWith("Vest") || TypeLine.EndsWith("Garb") || TypeLine.EndsWith("Wrap") || TypeLine.EndsWith("Vestment") || TypeLine.EndsWith("Regalia") || TypeLine.EndsWith("Silks")) { return(2); } if (TypeLine.EndsWith("Circlet")) //Helm { return(3); } if (TypeLine.EndsWith("Gloves")) //Gloves { return(4); } if (TypeLine.EndsWith("Shield")) //Shield { return(5); } return(6); } else if (ClassCat == ClassIndex.Duelist) { //private static string[] PoeItemDuelistCatNames = { "1H Axe", "2H Axe", "1H Sword", "2H Sword", "Boots", "Chest", "Helment", "Gloves", "Shield", "Unknown" }; if (ItemProperties.Count > 0) { if (ItemProperties[0].Name == "One Handed Axe") { return(0); } if (ItemProperties[0].Name == "Two Handed Axe") { return(1); } if (ItemProperties[0].Name == "One Handed Sword") { return(2); } if (ItemProperties[0].Name == "Two Handed Sword") { return(3); } } if (TypeLine.EndsWith("Boots")) //boots { return(4); } if (TypeLine.EndsWith("Vest") || TypeLine.EndsWith("Brigandine") || TypeLine.EndsWith("Doublet") || TypeLine.EndsWith("Armor") || TypeLine.EndsWith("Wyrmscale") || TypeLine.EndsWith("Lamellar")) //chest { return(5); } if (TypeLine.EndsWith("Helmet")) //helment { return(6); } if (TypeLine.EndsWith("Gauntlets")) //gloves { return(7); } if (TypeLine.EndsWith("Shield")) //shield { return(8); } return(9); } else if (ClassCat == ClassIndex.Templar) { //private static string[] PoeItemTemplarCatNames = { "1H Mace", "Staff", "Boots", "Chest", "Helment", "Gloves", "Shield", "Unknown" }; if (ItemProperties.Count > 0) { if (ItemProperties[0].Name == "One Handed Mace") { return(0); } if (ItemProperties[0].Name == "Staff") { return(1); } } if (TypeLine.EndsWith("Boots")) //boots { return(2); } if (TypeLine.EndsWith("Vest") || TypeLine.EndsWith("Tunic") || TypeLine.EndsWith("Coat") || TypeLine.EndsWith("Doublet") || TypeLine.EndsWith("Ringmail") || TypeLine.EndsWith("Chainmail") || TypeLine.EndsWith("Hauberk")) //chest { return(3); } if (TypeLine.EndsWith("Coif")) //helment { return(4); } if (TypeLine.EndsWith("Gloves")) //gloves { return(5); } if (TypeLine.EndsWith("Shield") || TypeLine.EndsWith("Bundle")) //shield { return(6); } return(7); } else if (ClassCat == ClassIndex.Shadow) { //private static string[] PoeItemShadowCatNames = { "Claw", "Dagger", "Boots", "Chest", "Helment", "Gloves", "Shield", "Unknown" }; if (ItemProperties.Count > 0) { if (ItemProperties[0].Name == "Claw") { return(0); } if (ItemProperties[0].Name == "Dagger") { return(1); } } if (TypeLine.EndsWith("Boots")) //boots { return(2); } if (TypeLine.EndsWith("Vest") || TypeLine.EndsWith("Jacket") || TypeLine.EndsWith("Coat") || TypeLine.EndsWith("Raiment") || TypeLine.EndsWith("Garb") || TypeLine.EndsWith("Armor")) //chest { return(3); } if (TypeLine.EndsWith("Mask")) //helment { return(4); } if (TypeLine.EndsWith("Mitts")) //gloves { return(5); } if (TypeLine.EndsWith("Shield")) //shield { return(6); } return(7); } return(0); }
private ClassIndex FindClassCat() { ClassIndex[] ClassTable = { ClassIndex.Misc, ClassIndex.Marauder, ClassIndex.Ranger, ClassIndex.Duelist, ClassIndex.Witch, ClassIndex.Templar,ClassIndex.Shadow, ClassIndex.Misc }; if (FrameType == FrameTypeIndex.Gem || FrameType == FrameTypeIndex.Unique) { return(ClassIndex.Misc); } byte Dex = 0, Int = 0, Str = 0; foreach (ItemProperty p in ItemRequirements) { if (p.Name.StartsWith("Dex")) { Dex = 2; } else if (p.Name.StartsWith("Str")) { Str = 1; } else if (p.Name.StartsWith("Int")) { Int = 4; } } ClassIndex ret = ClassTable[Int | Dex | Str]; if (ret != ClassIndex.Misc) { return(ret); } foreach (ItemProperty p in ItemProperties) { if (p.Name == "Evasion Rating") { Dex = 2; } else if (p.Name == "Armour") { Str = 1; } else if (p.Name == "Energy Shield") { Int = 4; } } ret = ClassTable[Int | Dex | Str]; if (ret != ClassIndex.Misc) { return(ret); } //Quivers goes to rangers.. if (TypeLine.EndsWith("Quiver")) { return(ClassIndex.Ranger); } if (ItemProperties.Count == 0) { return(ClassIndex.Misc); } if (ItemProperties[0].Name == "Bow") { return(ClassIndex.Ranger); } if (ItemProperties[0].Name == "Staff") { return(ClassIndex.Templar); } return(ClassIndex.Misc); }
private static IEnumerable <AssemblyLine> ParseInputFile(string inputFile) { var currentLineCount = 0; var typeLines = new List <TypeLine>(); var assemblyLines = new List <AssemblyLine>(); using (var reader = new StreamReader(inputFile)) { while (!reader.EndOfStream) { currentLineCount++; var currentLine = reader.ReadLine(); if (string.IsNullOrEmpty(currentLine)) { continue; } if (currentLine.Trim() == "") { continue; } if (currentLine.ToLower().Trim().Equals("break;")) { break; } if (currentLine.ToLower().Trim().Equals("return;")) { return(assemblyLines); } if (!currentLine.ToLower().Trim().StartsWith("//")) { if (AssemblyLine.IsAssembly(currentLine)) { var assemblyLine = new AssemblyLine(currentLineCount, currentLine); assemblyLines.Add(assemblyLine); } else if (TypeLine.IsType(currentLine)) { if (assemblyLines.Count == 0) { "CryoAOP -> Error:{0}! Could not find matching assembly tag for type ... ".Error( currentLineCount.ToString()); "CryoAOP -> '{0}'".Error(currentLine.Trim()); WriteUsage(); return(assemblyLines); } var typeLine = new TypeLine(currentLineCount, currentLine); assemblyLines.Last().Types.Add(typeLine); typeLines.Add(typeLine); } else if (MethodLine.IsMethod(currentLine)) { if (assemblyLines.Count == 0 && typeLines.Count == 0) { "CryoAOP -> Error:{0}! Could not find matching type tag for method ... ".Error( currentLineCount.ToString()); "CryoAOP -> '{0}'".Error(currentLine.Trim()); WriteUsage(); return(assemblyLines); } var methodLine = new MethodLine(currentLineCount, currentLine); typeLines.Last().Methods.Add(methodLine); } else if (PropertyLine.IsProperty(currentLine)) { if (assemblyLines.Count == 0 && typeLines.Count == 0) { "CryoAOP -> Error:{0}! Could not find matching type tag for property ... ".Error( currentLineCount.ToString()); "CryoAOP -> '{0}'".Error(currentLine.Trim()); WriteUsage(); return(assemblyLines); } var propertyLine = new PropertyLine(currentLineCount, currentLine); typeLines.Last().Properties.Add(propertyLine); } else { "CryoAOP -> Warning:{0}! Ignoring line because entry appears to be invalid ... ".Warn( currentLineCount); "CryoAOP -> '{0}'".Warn(currentLine.Trim()); } } } } return(assemblyLines); }