question.
Since the methodmaps are just syntactic sugar, does that I mean I can use the constructor function to directly access properties and method functions instead of creating an instance of the methodmap?
Here's what I mean in code.
PHP Code:
methodmap BaseMap
{
public BaseMap (const int ind, bool uid = false)
{
if (uid) {
return view_as<BaseMap>( ind );
}
return view_as<BaseMap>( GetClientUserId(ind) );
}
property int userid {
public get() { return view_as<int>(this); }
}
property int index {
public get() { return GetClientOfUserId( this.userid ); }
}
public void Funcz () {}
};
public void OnPluginStart ()
{
int Arr[MAXPLAYERS+1];
for (int i = MaxClients ; i ; --i)
{
Arr[i] = BaseMap(i).userid;
BaseMap(i).Funcz();
}
}
Secondly, would it be more efficient to do that in a loop or create an instance before hand and reassign it each loop?
__________________