Data Structures | Typedefs | Enumerations | Functions
mon-list.h File Reference

Monster list construction. More...

#include "angband.h"

Go to the source code of this file.

Data Structures

struct  monster_list_entry_s
struct  monster_list_s


typedef enum monster_list_section_e monster_list_section_t
typedef struct monster_list_entry_s monster_list_entry_t
typedef struct monster_list_s monster_list_t




monster_list_tmonster_list_new (void)
 Allocate a new monster list based on the size of the current cave's monster array. More...
void monster_list_free (monster_list_t *list)
 Free a monster list. More...
void monster_list_init (void)
 Initialize the monster list module. More...
void monster_list_finalize (void)
 Tear down the monster list module. More...
monster_list_tmonster_list_shared_instance (void)
 Return a common monster list instance. More...
void monster_list_reset (monster_list_t *list)
 Zero out the contents of a monster list. More...
void monster_list_collect (monster_list_t *list)
 Collect monster information from the current cave's monster list. More...
int monster_list_standard_compare (const void *a, const void *b)
 Standard comparison function for the monster list: sort by depth and then power. More...
void monster_list_sort (monster_list_t *list, int(*compare)(const void *, const void *))
 Sort the monster list with the given sort function. More...
byte monster_list_entry_line_color (const monster_list_entry_t *entry)
 Return an color to display a particular list entry with. More...

Detailed Description

Monster list construction.

Copyright (c) 1997-2007 Ben Harrison, James E. Wilson, Robert A. Koeneke Copyright (c) 2013 Ben Semmler

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

◆ monster_list_entry_t

◆ monster_list_section_t

◆ monster_list_t

Enumeration Type Documentation

◆ monster_list_section_e


Function Documentation

◆ monster_list_collect()

void monster_list_collect ( monster_list_t list)

◆ monster_list_entry_line_color()

byte monster_list_entry_line_color ( const monster_list_entry_t entry)

Return an color to display a particular list entry with.

entryis the monster list entry to display.
a color for the monster entry.

References COLOUR_RED, COLOUR_VIOLET, COLOUR_WHITE, player::depth, monster_race::flags, monster_race::level, monster_list_entry_s::race, and rf_has.

Referenced by monster_list_format_section().

◆ monster_list_finalize()

void monster_list_finalize ( void  )

Tear down the monster list module.

References monster_list_free().

Referenced by cleanup_angband().

◆ monster_list_free()

void monster_list_free ( monster_list_t list)

Free a monster list.

References monster_list_s::entries, and mem_free().

Referenced by monster_list_finalize(), and monster_list_show_interactive().

◆ monster_list_init()

void monster_list_init ( void  )

Initialize the monster list module.

Referenced by init_angband().

◆ monster_list_new()

monster_list_t* monster_list_new ( void  )

Allocate a new monster list based on the size of the current cave's monster array.

References cave, cave_monster_max(), monster_list_s::entries, monster_list_s::entries_size, mem_free(), mem_zalloc(), and size.

Referenced by monster_list_shared_instance(), and monster_list_show_interactive().

◆ monster_list_reset()

void monster_list_reset ( monster_list_t list)

Zero out the contents of a monster list.

If needed, this function will reallocate the entry list if the number of monsters has changed.

References cave, cave_monster_max(), monster_list_s::creation_turn, monster_list_s::distinct_entries, monster_list_s::entries, monster_list_s::entries_size, mem_realloc(), MONSTER_LIST_SECTION_MAX, monster_list_s::sorted, monster_list_s::total_entries, and monster_list_s::total_monsters.

Referenced by monster_list_show_subwindow().

◆ monster_list_shared_instance()

monster_list_t* monster_list_shared_instance ( void  )

Return a common monster list instance.

References monster_list_new(), and monster_list_subwindow.

Referenced by monster_list_force_subwindow_update(), and monster_list_show_subwindow().

◆ monster_list_sort()

void monster_list_sort ( monster_list_t list,
int(*)(const void *, const void *)  compare 

◆ monster_list_standard_compare()

int monster_list_standard_compare ( const void a,
const void b 

Standard comparison function for the monster list: sort by depth and then power.

References monster_race::level.

Referenced by monster_list_show_interactive(), and monster_list_show_subwindow().