#include "operation.h"
#include "../function_call/functioncall.h"
#include<stdlib.h>

Operation* _Operation_Constructor(FunctionCall* functionDo, FunctionCall* functionUndo){
    Operation* operation = (Operation*)malloc(sizeof(Operation));
    operation->functionDo = functionDo;
    operation->functionUndo = functionUndo;
    return operation;
}

void _Operation_Destructor(Operation* operation){
    _FunctionCall_Destructor(operation->functionDo);
    _FunctionCall_Destructor(operation->functionUndo);
    free(operation);
}

void _Operation_Do(Operation* operation){
    _FunctionCall_Execute(operation->functionDo);
}

void _Operation_Undo(Operation* operation){
    _FunctionCall_Execute(operation->functionUndo);
}