Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "character_base.h"
00027 #include <iostream>
00028
00029 using namespace std;
00030
00031
00032 character_base::character_base ()
00033 {
00034 color = 1;
00035 name = "";
00036 dialogue = "";
00037
00038
00039 set_val ("type", NPC);
00040 }
00041
00042 character_base::~character_base ()
00043 {
00044 }
00045
00046 void character_base::set_name (string newname)
00047 {
00048 name = newname;
00049 }
00050
00051 void character_base::set_dialogue (string newdlg)
00052 {
00053 dialogue = newdlg;
00054 }
00055
00056 void character_base::put_state(ogzstream& out)
00057 {
00058 storage::iterator i;
00059
00060 u_int32 j;
00061
00062
00063 name >> out;
00064
00065
00066 color >> out;
00067
00068
00069 j = size ();
00070 j >> out;
00071
00072 for (i = begin (); i != end (); i++)
00073 {
00074 string s = (*i).first;
00075 s >> out;
00076 (*i).second >> out;
00077 }
00078
00079 dialogue >> out;
00080 portrait >> out;
00081 }
00082
00083 void character_base::get_state (igzstream& in)
00084 {
00085 u_int32 i, size;
00086 s_int32 value;
00087
00088
00089 name << in;
00090
00091
00092 color << in;
00093
00094
00095 size << in;
00096 for (i = 0; i < size; i++)
00097 {
00098 string key;
00099 key << in;
00100
00101
00102
00103 value << in;
00104 set_val (key.c_str (), value);
00105 }
00106
00107 dialogue << in;
00108 portrait << in;
00109 }