ScummVM API documentation
Ultima::Nuvie::ActorManager Class Reference

Public Member Functions

 ActorManager (const Configuration *cfg, Map *m, TileManager *tm, ObjManager *om, GameClock *c)
 
void init ()
 
void clean ()
 
bool load (NuvieIO *objlist)
 
bool save (NuvieIO *objlist)
 
ActorListget_actor_list ()
 
ActorListsort_nearest (ActorList *list, uint16 x, uint16 y, uint8 z)
 
ActorListfilter_distance (ActorList *list, uint16 x, uint16 y, uint8 z, uint16 dist)
 
ActorListfilter_alignment (ActorList *list, ActorAlignment align)
 
ActorListfilter_party (ActorList *list)
 
Actorget_actor (uint8 actor_num) const
 
Actorget_actor (uint16 x, uint16 y, uint8 z, bool inc_surrounding_objs=true, Actor *excluded_actor=nullptr)
 
Actorget_actor_holding_obj (Obj *obj)
 
template<typename F >
ActorfindActorAt (uint16 x, uint16 y, uint8 z, F predicate, bool incDoubleTile=true, bool incSurroundingObjs=true)
 Find first actor at location for which predicate function returns true. More...
 
Actorget_avatar ()
 
Actorget_player ()
 
void set_player (Actor *a)
 
const char * look_actor (const Actor *a, bool show_prefix=true)
 
void set_update (bool u)
 
bool get_update () const
 
void set_combat_movement (bool c)
 
void updateActors (uint16 x, uint16 y, uint8 z)
 
void twitchActors ()
 
void moveActors ()
 
void startActors ()
 
void updateSchedules (bool teleport=false)
 
void clear_actor (Actor *actor)
 
bool resurrect_actor (Obj *actor_obj, MapCoord new_position)
 
bool is_temp_actor (Actor *actor)
 
bool is_temp_actor (uint8 id_n)
 
bool create_temp_actor (uint16 obj_n, uint8 obj_status, uint16 x, uint16 y, uint8 z, ActorAlignment alignment, uint8 worktype, Actor **new_actor=nullptr)
 
bool clone_actor (Actor *actor, Actor **new_actor, MapCoord new_location)
 
bool toss_actor (Actor *actor, uint16 xrange, uint16 yrange)
 
bool toss_actor_get_location (uint16 start_x, uint16 start_y, uint8 start_z, uint16 xrange, uint16 yrange, MapCoord *location)
 
void print_actor (Actor *actor)
 
bool can_put_actor (const MapCoord &location)
 
void enable_temp_actor_cleaning (bool value)
 

Protected Member Functions

Actorget_multi_tile_actor (uint16 x, uint16 y, uint8 z)
 
bool loadActorSchedules ()
 
Actorfind_free_temp_actor ()
 
ActorListfilter_active_actors (ActorList *list, uint16 x, uint16 y, uint8 z)
 
void update_temp_actors (uint16 x, uint16 y, uint8 z)
 
void clean_temp_actors_from_level (uint8 level)
 
void clean_temp_actors_from_area (uint16 x, uint16 y)
 
void clean_temp_actor (Actor *actor)
 

Member Function Documentation

◆ findActorAt()

template<typename F >
Actor* Ultima::Nuvie::ActorManager::findActorAt ( uint16  x,
uint16  y,
uint8  z,
predicate,
bool  incDoubleTile = true,
bool  incSurroundingObjs = true 
)
inline

Find first actor at location for which predicate function returns true.

Parameters
xworld coordinate
yworld coordinate
zlevel
predicatepredicate function/lambda of the form: bool f(const Actor*)
incDoubleTileinclude all tiles of double width/height actors
incSurroundingObjsinclude surrounding actor objects
Returns
pointer to actor or nullptr

The documentation for this class was generated from the following file: