public void Read(BinaryReader reader, int subtype, PSDLFile parent) { var numSections = (ushort)subtype; if (numSections == 0) { numSections = reader.ReadUInt16(); } var flagType = reader.ReadByte(); DividerFlags = (DividerFlags)(flagType >> 2); DividerType = (DividerType)(flagType & 3); DividerTexture = reader.ReadByte(); //texture for divider what the f**k Angel!? DividerTextures = new[] { parent.GetTextureFromCache(DividerTexture - 1), parent.GetTextureFromCache(DividerTexture), parent.GetTextureFromCache(DividerTexture + 1), parent.GetTextureFromCache(DividerTexture + 2) }; Value = reader.ReadUInt16(); for (var i = 0; i < numSections * 6; i++) { var vertexIndex = reader.ReadUInt16(); Vertices.Add(parent.Vertices[vertexIndex]); } }
internal static int GetApiDividerType(DividerType dividerType) { switch (dividerType) { case DividerType.Episode: { return(PluginConstants.DIVIDER_Episode); } case DividerType.Group: { return(PluginConstants.DIVIDER_Group); } case DividerType.EndDiv: { return(PluginConstants.DIVIDER_EndDiv); } default: { throw new NotImplementedException($"Unknown divider type {dividerType}"); } } }
public static IDataDivider CreateDivider(DividerType dividerType) { switch (dividerType) { case DividerType.STATIC: default: return(new StaticDivider()); case DividerType.RANDOMIZED: return(new RandomizedDivider()); case DividerType.INDEXED: return(new IndexedDivider()); } }
public static string ToDescriptionString(this DividerType val) { var attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false); return(attributes.Length > 0 ? attributes[0].Description : string.Empty); }
public Divider(DividerType type = DividerType.Horizontal) { Type = type; Style = "divider_default"; }