Angband
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

Typedefs

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

Enumerations

enum  monster_list_section_e { MONSTER_LIST_SECTION_LOS = 0, MONSTER_LIST_SECTION_ESP, MONSTER_LIST_SECTION_MAX }

Functions

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

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

Enumeration Type Documentation

Enumerator:
MONSTER_LIST_SECTION_LOS 
MONSTER_LIST_SECTION_ESP 
MONSTER_LIST_SECTION_MAX 

Function Documentation

void monster_list_collect ( monster_list_t list)
byte monster_list_entry_line_color ( const monster_list_entry_t entry)

Return an color to display a particular list entry with.

Parameters
entryis the monster list entry to display.
Returns
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().

void monster_list_finalize ( void  )

Tear down the monster list module.

References monster_list_free().

Referenced by cleanup_angband().

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().

void monster_list_init ( void  )

Initialize the monster list module.

Referenced by init_angband().

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().

void monster_list_reset ( monster_list_t list)
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().

void monster_list_sort ( monster_list_t list,
int(*)(const void *, const void *)  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, and monster_race::power.

Referenced by monster_list_show_interactive(), and monster_list_show_subwindow().