-- не настраивать
require( "scripts/game/deftime.lua" );
require( "scripts/game/deftasks.lua" );
GameObject = {
    Params = {
        ID="firewood";
        width=1;
        height=1;
        --RandomTasks=0;
        --create_product = 20;  -- сколько создаёт продукта(дров)
        --product_name = "firewood"; -- do not change this parameter
        GridData= { 1 };
        action_enabled = 0;
        select_type = 2;
    };
    ActivePoints = { 
        plank = { 
                   { {"cowshed", "sheephouse","henhouse1", "goathouse"}, 1,0,0,  0,  1,0,0 };
                   }; 
    };
    Objects = {};
    -- list of all tasks for an object
    Tasks = {
        take_plank = { FuncName="PlankTakeExecute", sleeping={0}, time_tick=10, not_need_action=1, skill_up = 0, restore_health=1000 };
    };
    -- list of all triggers for an object
    Triggers = {};
    --tasks to be performed after an object is created
    InitActiveTasks = {};
    --tasks an object is waiting ofr after it is created
    InitExpectedTasks = {};
    Action = {  
        Name = "plank";  
        IDs = {"cowshed", "sheephouse","henhouse1", "goathouse"};
        CanMany = 0;
    }
};
function GameObject:Get()
    return self;
end

aObj = GameObject:Get();   
if( not aObj.Params.MaxHealth )then
    aObj.Params.MaxHealth = aObj.Params.health;
end;
    

function GetParams()
    aObj = GameObject:Get();   
    return aObj.Params;
end

function PlankOn()
    aObj = GameObject:Get();   
    aObj.Params.action_enabled = 0;
    CPP_SetAnimState("chopping4");
    --CPP_WantSelect(1);
    --ScriptDump("PortionOn");
end

-- perform Task EATING over external object and return true if task is completed
function PlankTakeExecute()
    aObject = GameObject:Get();
    --CPP_CreateProduct(aObject.Params.product_name,GetProductCreate());
    aObj.Params.action_enabled = 0;
    CPP_RunStringParent("TakePlank();");
    CPP_SetAnimState("normal");
    return 0;
end
