public static FrameItem Create(BinaryReader reader) { FrameItem frameItem = null; var type = reader.ReadUInt32AsEnum <FrameItemType>(); switch (type) { case FrameItemType.Action: frameItem = Action.Parse(reader); break; case FrameItemType.FrameLabel: frameItem = FrameLabel.Parse(reader); break; case FrameItemType.PlaceObject: frameItem = PlaceObject.Parse(reader); break; case FrameItemType.RemoveObject: frameItem = RemoveObject.Parse(reader); break; case FrameItemType.BackgroundColor: frameItem = BackgroundColor.Parse(reader); break; case FrameItemType.InitAction: frameItem = InitAction.Parse(reader); break; } return(frameItem); }
public static InitAction Parse(BinaryReader reader) { var action = new InitAction(); action.Sprite = reader.ReadUInt32(); var instructionsPosition = reader.ReadUInt32(); action.Instructions = InstructionCollection.Parse(reader.BaseStream, instructionsPosition); return(action); }