To @Wiineri: glad to see someone else works in this field.
And I don't thought about cut-scene problem before.
Keep going man!
///////////////////////////////////////////////////////////////////
I have a dream...to parse SQF code and to interpret it like CSharp-like OOP language
2 functions to be developed:
1) OOP_Create: define new class with props, default values and methods.
All objects are arrays with "type" (0th element == case-sensitive class name)
Object itself is always mentioned as 0th argument in all methods.
Methods and props are stored in "parallel" global arrays with class types array.
For example: lets suppose I already created 2 classes:
OOP_Types array: ["Line","Circle"]
OOP_Props array:
[
["start","end"],
["centre","radius"]
]
OOP_MethodNames array:
[
["Angle","CheckDotSide","Rotate","Shift"],
["Rotate","Shift","Area","HasPoint","IntersLine"]
]
OOP_Methods array:
[
["code3","code4","code5","code6"],
["code7","code8","code9","code10","code11"]
]
_sh={
private["_p", "_x", "_y"];
_p=_this select 0;
_x=_this select 1;
_y=_this select 2;
_p set [1, _x+(_this select 1)];
_p set [2, _y+(_this select 2)];
};
Creating another one:
"Point(x,y): {x=0, y=0, Shift(a,b)=_sh}" call OOP_Create;
So now:
OOP_Types: ["Line","Circle","Point"]
OOP_Props:
[
["start", "end"],
["centre", "radius"],
["x", "y"]
]
OOP_MethodNames:
[
["Angle","CheckDotSide","Rotate","Shift"],
["Rotate","Shift","Area","HasPoint","IntersLine"],
["Shift"]
]
OOP_Methods:
[
["code3","code4","code5","code6"],
["code7","code8","code9","code10","code11"],
[_sh]
]
2) OOP_Run: actions with created instances.
"()" brackets and word "new" are reserved 4 correct interpretation
{
_p=new Point (2000, 3000);
_p.Shift(100,-200) ;
} call OOP_Run;
Bad: Fwatch character number limitations + speed lost on "interpretation"
Good: nothing wrong happens if we will use OOP_Run for shorter "OOP-code" sets.
Like that:
{_such_a_big_point=new Point (2000, 3000)} call OOP_Run;
{_such_a_big_point.Shift(100,-200)} call OOP_Run;
This code must return: ["Point", 2100, 2800]
hint format["Point: %1", _such_a_big_point];
//////////////////////////////////////////////////
Any ideas, propositions, wishes, warnings, critical notes?