elanc Какой пруф? За тебя написать, то к чему даже и case не нужен по факту?
Задачка для дошкольников:
class Zona
{
vector cv_Position = {0,0,0};
int cv_Radius = 0;
void Zona(vector v_Position, int v_Radius)
{
cv_Position = v_Position;
cv_Radius = v_Radius;
}
bool inZone(PlayerBase v_player)
{
if ( vector.Distance(v_player.GetPosition(), cv_Position) < cv_Radius )
{reutrn true;}
return false;
}
}
class Zones
{
static ref array<ref Zona> cv_Zones = new array<ref Zona>;
static void InsertZone(vector v_Position, int v_Radius)
{cv_Zones.Insert( new Zona(v_Position, v_Radius) );}
}
.......
Zones.InsertZone( Vector(0,0,0), 100 );
.......
ref array<Man> v_Players = new array<Man>;
PlayerBase v_Player = NULL;
int v_I = 0;
int v_X = 0;
GetGame().GetPlayers( v_Players );
for( v_I = 0; v_I < v_Players.Count(); v_I++ )
{
v_Player = v_Players[v_I];
for( v_X = 0; v_X < Zones.cv_Zones.Count(); v_X++ )
{
if ( Zones.cv_Zones[v_X].inZone(v_Player) )
{
//Что то делаем
break;
}
}
}