private void RedrawDisplayIfNeeded(IExecutableInstruction instruction) { if (instruction is DRW) { Display.RedrawDisplay(); } }
private void ExecuteInstruction(InstructionDTO instructionData, IExecutableInstruction instruction) { ValidateInstruction(instructionData, instruction); instruction.Execute(instructionData, this); RedrawDisplayIfNeeded(instruction); }
private void ValidateInstruction(InstructionDTO instructionData, IExecutableInstruction instruction) { /* if (instructionData == null || instructionData.RawData.All(x => x == 0)) * { * throw new Exception("Instruction data cannot be null or empty"); * } * if (instruction == null) * { * // throw new Exception("Instruction implementation cannot be null"); * }*/ }