/// <summary> /// Parses the tokens of the chunk. /// </summary> /// <param name="tokens">The tokens.</param> internal override void ParseTokens(string[] tokens) { var chunks = Tokenizer.SplitChunks(tokens); foreach (var chunk in chunks) { int index = 0; switch (chunk.Ident) { case "rgb": this.Red = (byte)Tokenizer.ReadInt(chunk.Tokens, ref index); this.Green = (byte)Tokenizer.ReadInt(chunk.Tokens, ref index); this.Blue = (byte)Tokenizer.ReadInt(chunk.Tokens, ref index); break; case "factor": this.WeightingFactor = Tokenizer.ReadFloat(chunk.Tokens, ref index); break; case "texturename": this.TextureName = Tokenizer.ReadString(chunk.Tokens, ref index); break; case "textureparams": { var textureParams = new An8TextureParams(); textureParams.ParseTokens(chunk.Tokens); this.TextureParams = textureParams; break; } } } }
/// <summary> /// Parses the tokens of the chunk. /// </summary> /// <param name="tokens">The tokens.</param> internal override void ParseTokens(string[] tokens) { var chunks = Tokenizer.SplitChunks(tokens); foreach (var chunk in chunks) { int index = 0; switch (chunk.Ident) { case "kind": this.Kind = Tokenizer.ReadString(chunk.Tokens, ref index); break; case "texturename": this.TextureName = Tokenizer.ReadString(chunk.Tokens, ref index); break; case "textureparams": { var textureParams = new An8TextureParams(); textureParams.ParseTokens(chunk.Tokens); this.TextureParams = textureParams; break; } } } }