22 #ifndef NUVIE_ACTORS_ACTOR_MANAGER_H 23 #define NUVIE_ACTORS_ACTOR_MANAGER_H 25 #include "ultima/shared/std/string.h" 26 #include "ultima/nuvie/core/obj_manager.h" 27 #include "ultima/nuvie/misc/actor_list.h" 28 #include "ultima/nuvie/actors/actor.h" 40 #define ACTORMANAGER_MAX_ACTORS 256 50 bool should_clean_temp_actors;
53 Actor *actors[ACTORMANAGER_MAX_ACTORS];
55 uint8 temp_actor_offset;
58 uint16 last_obj_blk_x, last_obj_blk_y;
81 Actor *get_actor(uint8 actor_num)
const;
82 Actor *get_actor(uint16 x, uint16 y, uint8 z,
bool inc_surrounding_objs =
true,
Actor *excluded_actor =
nullptr);
83 Actor *get_actor_holding_obj(
Obj *obj);
86 Actor *findActorAtImpl(uint16 x, uint16 y, uint8 z,
bool(*predicateWrapper)(
void *,
const Actor *),
bool incDoubleTile,
bool incSurroundingObjs,
void *predicate)
const;
100 Actor *
findActorAt(uint16 x, uint16 y, uint8 z, F predicate,
bool incDoubleTile =
true,
bool incSurroundingObjs =
true) {
105 auto predicateWrapper = +[](
void *wrappedPredicate,
const Actor *a) ->
bool {
106 return (*(F*)wrappedPredicate)(a);
108 return findActorAtImpl(x, y, z, predicateWrapper, incDoubleTile, incSurroundingObjs, &predicate);
114 void set_player(
Actor *a);
116 const char *look_actor(
const Actor *a,
bool show_prefix =
true);
118 void set_update(
bool u) {
121 bool get_update()
const {
124 void set_combat_movement(
bool c);
126 void updateActors(uint16 x, uint16 y, uint8 z);
130 void updateSchedules(
bool teleport =
false);
132 void clear_actor(
Actor *actor);
133 bool resurrect_actor(
Obj *actor_obj,
MapCoord new_position);
135 bool is_temp_actor(
Actor *actor);
136 bool is_temp_actor(uint8 id_n);
137 bool create_temp_actor(uint16 obj_n, uint8 obj_status, uint16 x, uint16 y, uint8 z, ActorAlignment alignment, uint8 worktype,
Actor **new_actor =
nullptr);
139 bool toss_actor(
Actor *actor, uint16 xrange, uint16 yrange);
140 bool toss_actor_get_location(uint16 start_x, uint16 start_y, uint8 start_z, uint16 xrange, uint16 yrange,
MapCoord *location);
141 void print_actor(
Actor *actor);
142 bool can_put_actor(
const MapCoord &location);
143 void enable_temp_actor_cleaning(
bool value) {
144 should_clean_temp_actors = value;
149 Actor *get_multi_tile_actor(uint16 x, uint16 y, uint8 z);
151 bool loadActorSchedules();
152 inline Actor *find_free_temp_actor();
155 void update_temp_actors(uint16 x, uint16 y, uint8 z);
156 void clean_temp_actors_from_level(uint8 level);
157 void clean_temp_actors_from_area(uint16 x, uint16 y);
159 inline void clean_temp_actor(
Actor *actor);
163 bool loadCustomTiles(nuvie_game_t game_type);
Definition: containers.h:120
Definition: configuration.h:61
Actor * findActorAt(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.
Definition: actor_manager.h:100
Definition: game_clock.h:49
Definition: tile_manager.h:145
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: obj_manager.h:75
Definition: containers.h:38
Definition: nuvie_io.h:32