-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchar.py
34 lines (25 loc) · 807 Bytes
/
char.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Character handler component for LamiaDMBot
class Character:
"""Basic character definition class"""
def __init__(self, attlist={}):
self.attlist = {}
try:
self.attlist = attlist
except:
pass
def getAttribute(self, attname): #Gets a specific attribute by name. Returns False if such attribute does not exist
if attname in self.attlist:
return self.attlist[attname]
else:
return False
def setAttribute(self, attname, attval): #Sets a specific attribute by name. Returns True if said attribute exists, and False if it doesn't
if attname in self.attlist:
self.attlist[attname] = attval
return True
else:
return False
if __name__ == '__main__':
print "This is not meant to be used directly! Run 'main.py' instead."