本文整理汇总了C++中Map::GetActor方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::GetActor方法的具体用法?C++ Map::GetActor怎么用?C++ Map::GetActor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::GetActor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Targets
Targets *GetAllActors(Scriptable *Sender, int ga_flags)
{
Map *map = Sender->GetCurrentArea();
int i = map->GetActorCount(true);
Targets *tgts = new Targets();
while (i--) {
Actor *ac = map->GetActor(i,true);
int dist = Distance(Sender->Pos, ac->Pos);
tgts->AddTarget((Scriptable *) ac, dist, ga_flags);
}
return tgts;
}
示例2: while
Targets *GameScript::SelectedCharacter(Scriptable* Sender, Targets* parameters, int ga_flags)
{
Map *cm = Sender->GetCurrentArea();
parameters->Clear();
int i = cm->GetActorCount(true);
while (i--) {
Actor *ac=cm->GetActor(i,true);
if (ac->GetCurrentArea()!=cm) {
continue;
}
if (ac->IsSelected()) {
parameters->AddTarget(ac, Distance(Sender, ac), ga_flags );
}
}
return parameters;
}
示例3: Targets
Targets *GetAllActors(Scriptable *Sender, int ga_flags)
{
Map *map = Sender->GetCurrentArea();
int i = map->GetActorCount(true);
Targets *tgts = new Targets();
//make sure that Sender is always first in the list, even if there
//are other (e.g. dead) targets at the same location
tgts->AddTarget(Sender, 0, ga_flags);
while (i--) {
Actor *ac = map->GetActor(i,true);
if (ac != Sender) {
int dist = Distance(Sender->Pos, ac->Pos);
tgts->AddTarget(ac, dist, ga_flags);
}
}
return tgts;
}
示例4: XthNearestOf
Targets *XthNearestEnemyOf(Targets *parameters, int count, int ga_flags)
{
Actor *origin = (Actor *) parameters->GetTarget(0, ST_ACTOR);
parameters->Clear();
if (!origin) {
return parameters;
}
//determining the allegiance of the origin
int type = GetGroup(origin);
if (type==2) {
return parameters;
}
Map *map = origin->GetCurrentArea();
int i = map->GetActorCount(true);
ga_flags |= GA_NO_UNSCHEDULED;
while (i--) {
Actor *ac = map->GetActor(i,true);
if (ac == origin) continue;
int distance;
//int distance = Distance(ac, origin);
// TODO: if it turns out you need to check Sender here, beware you take the right distance!
// (n the original games, this is only used for NearestEnemyOf(Player1) in obsgolem.bcs)
if (!DoObjectChecks(map, origin, ac, distance)) continue;
if (type) { //origin is PC
if (ac->GetStat(IE_EA) >= EA_EVILCUTOFF) {
parameters->AddTarget(ac, distance, ga_flags);
}
}
else {
if (ac->GetStat(IE_EA) <= EA_GOODCUTOFF) {
parameters->AddTarget(ac, distance, ga_flags);
}
}
}
return XthNearestOf(parameters,count, ga_flags);
}