Options: Fix modifying or deleting of value returned by getenv
[roofball.git] / src / playeroptions.cc
blob05fe5f1be2a347b9f7e006167a9e057d61970633
1 #include "playeroptions.h"
2 #include "error.h"
3 #include <iostream>
4 #include <cstring>
6 PlayerOptions::PlayerOptions():
7 update(false) {
10 PlayerOptions::~PlayerOptions() {
13 void PlayerOptions::SetStyle(const char *n) {
14 strcpy(name, n);
16 if (strcmp(name, "Lake") == 0) {
17 colors.hair = 0x888888;
18 colors.shirt = 0;//x4a4a4a;
19 colors.pants = 0xc1b487;
20 colors.shoes = 0x444444;
22 else if (strcmp(name, "Make") == 0) {
23 colors.hair = 0xff7700;//ef9802;
24 colors.shirt = 0x1f00a0;
25 colors.pants = 0xa04c30;
26 colors.shoes = 0xffffff;
28 else if (strcmp(name, "Heke") == 0) {
29 colors.hair = 0xa05c09;
30 colors.shirt = 0xbb1111;
31 colors.pants = 0x505065;
32 colors.shoes = 0xe5b357;
34 else if (strcmp(name, "Tume") == 0) {
35 colors.hair = 0xaa9336;
36 colors.shirt = 0x5f7773;
37 colors.pants = 0xa09a82;
38 colors.shoes = 0x0000bb;
39 } else throw Error("PlayerOptions::SetStyle: Invalid player style requested");
41 update = true;
44 const char *PlayerOptions::GetName() const {
45 return (name);
48 const CharacterColors &PlayerOptions::GetColors() const {
49 return (colors);