using System; using System.Collections.Generic; namespace NW4RTools.Models { public class ByteCode { public enum OpType { None, Done, AssignNodeToParentMtx, BlendMatrices, DrawShape, AssignMtxToNode } public class Instruction { public virtual OpType GetOp() { return OpType.None; } } public class DoneInstruction : Instruction { public override OpType GetOp() { return OpType.Done; } } public class AssignNodeToParentMtxInstruction : Instruction { public override OpType GetOp() { return OpType.AssignNodeToParentMtx; } public UInt16 NodeID; public UInt16 ParentMatrixID; } public class BlendMatricesInstruction : Instruction { public override OpType GetOp() { return OpType.BlendMatrices; } public UInt16 MatrixID; public BlendedMatrix[] BlendedMatrices; public struct BlendedMatrix { public UInt16 MatrixID; public float Ratio; } } public class DrawShapeInstruction : Instruction { public override OpType GetOp() { return OpType.DrawShape; } public UInt16 MaterialID; public UInt16 ShapeID; public UInt16 NodeID; } public class AssignMtxToNodeInstruction : Instruction { public override OpType GetOp() { return OpType.AssignMtxToNode; } public UInt16 MatrixID; public UInt16 NodeID; } public List Instructions; public ByteCode() { Instructions = new List(); } } }