forked from dmangame/dmangame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapobject.py
executable file
·47 lines (39 loc) · 1.2 KB
/
mapobject.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
35
36
37
38
39
40
41
42
43
44
45
46
# The unit class for the game.
import random
import copy
import tuct
class MapObject:
def __init__():
pass
class Building(MapObject):
def __init__(self, worldtalker):
self.__wt = worldtalker
self.__stats = tuct.tuct({
"armor" : 1,
"attack" : 1,
"sight" : 1,
"energy" : 1,
"speed" : 5
})
def getTeam(self):
" Returns the owner of the building's team"
return self.__wt.getTeam(self)
team = property(getTeam)
def getStats(self):
" Returns a copy of this building's unit stat generation"
return copy.copy(self.__stats)
stats = property(getStats)
def getPosition(self):
" Returns the position of this Unit on the map"
return self.__wt.getPosition(self)
position = property(getPosition)
class Bullet(MapObject):
def __init__(self, unit, target):
self.__target = target
self.__unit = unit
def getUnit(self):
return self.__unit
unit = property(getUnit)
def getTarget(self):
return self.__target
target = property(getTarget)