Angband
Data Structures | Typedefs | Functions
z-type.h File Reference

Support various data types. More...

#include "h-basic.h"

Go to the source code of this file.

Data Structures

struct  loc
 
struct  grouper
 
struct  point_set
 A set of points that can be constructed to apply a set of changes to. More...
 

Typedefs

typedef struct grouper grouper
 Defines a (value, name) pairing. More...
 

Functions

struct loc loc (int x, int y)
 
bool loc_eq (struct loc grid1, struct loc grid2)
 Determine if two grid locations are equal. More...
 
bool loc_is_zero (struct loc grid)
 Determine if a grid location is the (0, 0) location. More...
 
struct loc loc_sum (struct loc grid1, struct loc grid2)
 Sum two grid locations. More...
 
struct loc loc_diff (struct loc grid1, struct loc grid2)
 Take the difference of two grid locations. More...
 
struct loc rand_loc (struct loc grid, int x_spread, int y_spread)
 Get a random location with the given x and y centres and spread. More...
 
struct point_setpoint_set_new (int initial_size)
 Utility functions to work with point_sets. More...
 
void point_set_dispose (struct point_set *ps)
 
void add_to_point_set (struct point_set *ps, struct loc grid)
 Add the point to the given point set, making more space if there is no more space left. More...
 
int point_set_size (struct point_set *ps)
 
int point_set_contains (struct point_set *ps, struct loc grid)
 

Detailed Description

Support various data types.

Copyright (c) 2007 Angband Developers

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Typedef Documentation

◆ grouper

typedef struct grouper grouper

Defines a (value, name) pairing.

Variable names used are historical.

Function Documentation

◆ add_to_point_set()

void add_to_point_set ( struct point_set ps,
struct loc  grid 
)

Add the point to the given point set, making more space if there is no more space left.

References point_set::allocated, mem_realloc(), point_set::n, and point_set::pts.

Referenced by cave_room_aux(), and target_get_monsters().

◆ loc()

struct loc loc ( int  x,
int  y 
)

References p, loc::x, and loc::y.

Referenced by alloc_stairs(), arena_gen(), become_viewable(), build_circular(), build_colors(), build_crossed(), build_large(), build_pit(), build_room_of_chambers(), build_room_template(), build_simple(), build_streamer(), build_vault(), calc_light(), cave_find(), cave_free(), cave_generate(), cave_illuminate(), cave_known(), chunk_copy(), chunk_validate_objects(), chunk_write(), clear_small_regions(), cmd_set_arg_point(), context_menu_cave(), display_map(), do_cmd_wiz_bamf(), do_cmd_wiz_features(), do_cmd_wiz_hack_nick(), do_cmd_wiz_query(), draw_rectangle(), drop_find_grid(), effect_handler_ARC(), effect_handler_BALL(), effect_handler_BREATH(), effect_handler_DESTRUCTION(), effect_handler_DETECT_DOORS(), effect_handler_DETECT_GOLD(), effect_handler_DETECT_OBJECTS(), effect_handler_DETECT_STAIRS(), effect_handler_DETECT_TRAPS(), effect_handler_EARTHQUAKE(), effect_handler_LASH(), effect_handler_MAP_AREA(), effect_handler_SENSE_OBJECTS(), effect_handler_SHORT_BEAM(), effect_handler_TELEPORT(), effect_handler_TELEPORT_TO(), fill_rectangle(), fill_xrange(), fill_yrange(), find_artifact(), find_nearby_grid(), find_start(), findpath(), floor_object_for_use(), gauntlet_gen(), generate_hole(), generate_open(), generate_plus(), generate_starburst_room(), get_chamber_monsters(), get_move(), get_move_find_hiding(), get_move_find_safety(), get_move_flee(), get_vault_monsters(), hard_centre_gen(), init_cavern(), inven_carry(), is_valid_pf(), loc_diff(), loc_is_zero(), loc_sum(), los(), make_chamber(), make_inner_chamber_wall(), mark_wasseen(), menu_layout(), monster_carry(), monster_near_permwall(), monster_turn_multiply(), next_grid(), object_delete(), object_flavor_aware(), origin_get_loc(), pick_and_place_distant_monster(), place_feeling(), prepare_next_level(), process_world(), project(), project_aimed(), project_path(), prt_map(), prt_map_aux(), push_object(), rand_loc(), ranged_helper(), rd_dungeon(), rd_dungeon_aux(), region_calculate(), room_build(), run_step(), run_test(), sanitize_player_loc(), see_wall(), spread_monsters(), square_destroy_decoy(), square_know_pile(), store_display_recalc(), summon_possible(), target_accept(), target_get_monsters(), target_set_interactive(), target_set_interactive_aux(), target_set_location(), test_dir_to(), textui_get_rep_dir(), textui_process_click(), thrust_away(), town_gen_layout(), update_mon(), update_view(), update_view_one(), vault_chunk(), wiz_dark(), wiz_light(), wr_dungeon_aux(), wr_objects_aux(), and wr_traps_aux().

◆ loc_diff()

struct loc loc_diff ( struct loc  grid1,
struct loc  grid2 
)

Take the difference of two grid locations.

References loc().

Referenced by blow_knock_back(), build_room_template(), build_tunnel(), cave_find_in_range(), get_move(), and thrust_away().

◆ loc_eq()

bool loc_eq ( struct loc  grid1,
struct loc  grid2 
)

◆ loc_is_zero()

bool loc_is_zero ( struct loc  grid)

◆ loc_sum()

struct loc loc_sum ( struct loc  grid1,
struct loc  grid2 
)

◆ point_set_contains()

int point_set_contains ( struct point_set ps,
struct loc  grid 
)

References i, loc_eq(), point_set::n, and point_set::pts.

Referenced by cave_room_aux().

◆ point_set_dispose()

void point_set_dispose ( struct point_set ps)

◆ point_set_new()

struct point_set* point_set_new ( int  initial_size)

Utility functions to work with point_sets.

References point_set::allocated, mem_alloc(), mem_zalloc(), point_set::n, and point_set::pts.

Referenced by light_room(), and target_get_monsters().

◆ point_set_size()

int point_set_size ( struct point_set ps)

◆ rand_loc()

struct loc rand_loc ( struct loc  grid,
int  x_spread,
int  y_spread 
)

Get a random location with the given x and y centres and spread.

References loc(), and rand_spread.

Referenced by build_streamer(), drop_find_grid(), effect_handler_TELEPORT_TO(), and scatter().