/[anoncvs]/projects/roguelike/Entity.cpp


UCC Code Repository

Contents of /projects/roguelike/Entity.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Apr 13 07:12:10 2006 UTC (15 years ago) by banana
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
Newlines at ends of files

1 /*
2 * Entity - a basic thing in the world. Could be terrain, objects, monsters, anything.
3 */
4
5 #include "Entity.h"
6 #include "core.h"
7
8 Entity::Entity(std::wstring n, wchar_t s, unsigned int c) {
9 name = n;
10 symbol = s;
11 colour = c;
12 }
13
14 Entity::Entity(std::wstring n, wchar_t s) {
15 name = n;
16 symbol = s;
17 colour = 0xFFFFFF00;
18 }
19
20 // This exists only to allow inheritance
21 Entity::Entity() {
22 seen = false;
23 }
24
25 /************
26 * Accessors *
27 ************/
28
29 std::wstring Entity::describe() {
30 return name;
31 }
32
33 attributed_char Entity::render() {
34 attributed_char c;
35 c.character = symbol;
36 c.colour = colour;
37
38 seen = true;
39
40 return c;
41 }
42
43 bool Entity::needsDisplay() {
44 return !seen;
45 }

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26