1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
#ifndef _BULLETIN_H
#define _BULLETIN_H
#include <stdio.h>
#include "strings.h"
#include "entity.h"
#include "flags.h"
#include "errlog.h"
class Inp_Handler;
class Player;
int bulletin_command_handler(MudObject *the_obj, char *the_input);
int bulletin_get_subject(MudObject *the_obj, char *the_input);
int post_on_pop(Inp_Handler *the_handler, char *notused1, char *notused2,
char *notused3, Strings *notused4);
int pop_on_pop(Inp_Handler *the_handler, char *notused1, char *notused2,
char *notused3, Strings *notused4);
class BullEntry;
class Bulletin : public Entity
{
public:
virtual ~Bulletin();
Bulletin(char *bull_name, int build_port);
void set_loc_str(char *the_str);
char *get_loc_str();
virtual int set_title(char *the_str);
char *get_title();
void set_authorized(char *the_str);
char *get_authorized();
int player_authorized(Player *the_player);
int load_bulletin(ErrLog *error_log);
int delete_bull(void);
void display_help(Player *the_player);
int add_entry(BullEntry *the_entry);
int delete_entry(int the_num);
int write_bull();
int list_entries(Player *the_player);
BullEntry *get_entry(int the_num);
Flags *get_bullflags();
virtual void describe(Builder *the_builder);
virtual void describe(Player *the_player);
virtual int set_attrib(Builder *the_builder, Parse *the_parsed);
virtual int copy_object(Entity *copy_obj);
virtual void write_object(FILE *the_file, int build_format);
int is_build_port();
virtual int get_mem_size();
virtual int get_mem_size_dynamic();
BullEntry **get_loaded_bull();
private:
Strings bullfilename;
FILE *the_bullfile;
Strings title;
Strings location;
Strings authorized;
BullEntry *loaded_bull;
BullEntry **build_ptr;
int for_builder;
Flags *bull_flags;
};
class BullEntry
{
public:
~BullEntry();
BullEntry(Bulletin *assign_board);
void set_author(char *the_str);
void set_subject(char *the_str);
void set_body(char *the_str);
void set_date();
char *get_date();
char *get_author();
char *get_subject();
char *get_body();
int edit_body(Player *the_player);
void copy_bull(BullEntry *copy_from);
BullEntry *get_next_bull();
void set_next_bull(BullEntry *new_bull);
int write_bull(FILE *the_file);
int read_bull(FILE *the_file, ErrLog *error_log);
void display_bull(Player *the_player);
void set_board(Bulletin *new_board);
Bulletin *get_board();
private:
Strings date;
Strings author;
Strings subject;
Strings body;
BullEntry *next_bull;
Bulletin *the_board;
};
#endif
|