Esempio n. 1
0
        public static InstructionSave FromInstructionBlueprint(FlatRedBall.Instructions.InstructionBlueprint template)
        {
            InstructionSave toReturn = new InstructionSave();

            toReturn.SetValuesFromTemplate(template);

            return(toReturn);
        }
Esempio n. 2
0
        public static InstructionSave FromInstruction(FlatRedBall.Instructions.GenericInstruction instruction)
        {
            InstructionSave instructionSaveToReturn = new InstructionSave();

            instructionSaveToReturn.SetValuesFromInstruction(instruction);

            return(instructionSaveToReturn);
        }
Esempio n. 3
0
        public static InstructionBlueprintListSave FromInstructionBlueprintList(InstructionBlueprintList InstructionBlueprintList)
        {
            InstructionBlueprintListSave itls = new InstructionBlueprintListSave();

            foreach (InstructionBlueprint template in InstructionBlueprintList)
            {
                itls.Instructions.Add(InstructionSave.FromInstructionBlueprint(template));
            }

            return(itls);
        }
        public void AddList(InstructionList list)
        {
            KeyframeSave keyframe = new KeyframeSave();

            foreach (Instruction instruction in list)
            {
                if (instruction is GenericInstruction)
                {
                    GenericInstruction asGenericInstruction = instruction as GenericInstruction;
                    InstructionSave    instructionSave      = InstructionSave.FromInstruction(asGenericInstruction);

                    keyframe.InstructionSaves.Add(instructionSave);
                }
                else
                {
                    throw new NotImplementedException("This list contains a type of instruction that cannot be saved.");
                }
            }
            keyframe.Name = list.Name;
            SceneKeyframes.Add(keyframe);
        }