*** empty log message ***

This commit is contained in:
Samir Naik 2005-04-18 20:56:23 +00:00
parent c60f0298c9
commit 20655d0303
4 changed files with 29 additions and 6 deletions

View File

@ -3,10 +3,15 @@
class CartesianGridBase:
def isValidZone(self, zoneId):
if self.style == "Cartesian":
if ((zoneId < self.startingZone) or
(zoneId > self.startingZone + self.gridSize * self.gridSize - 1)):
return 0
return 1
elif self.style == "CartesianStated":
return 1
else:
return 0
def getZoneFromXYZ(self, pos):
# NOTE: pos should be relative to our own grid origin

View File

@ -936,3 +936,22 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
def haveCreateAuthority(self):
return (self.DOIDlast > self.DOIDnext)
def getDoHierarchy(self):
return self.__doHierarchy
def getWorld(self, doId):
# Get the world node for this object
obj = self.doId2do[doId]
worldNP = obj.getParent()
while 1:
nextNP = worldNP.getParent()
if nextNP == render:
break
elif worldNP.isEmpty():
return None
return worldNP

View File

@ -12,9 +12,9 @@ class DistributedCartesianGridAI(DistributedNodeAI.DistributedNodeAI,
RuleSeparator = ":"
def __init__(self, air, startingZone, gridSize, gridRadius):
def __init__(self, air, startingZone, gridSize, gridRadius, style="Cartesian"):
DistributedNodeAI.DistributedNodeAI.__init__(self, air)
self.style = "Cartesian"
self.style = style
self.startingZone = startingZone
self.gridSize = gridSize
self.gridRadius = gridRadius

View File

@ -370,4 +370,3 @@ class DistributedObject(PandaObject):
def isGridParent(self):
# If this distributed object is a DistributedGrid return 1. 0 by default
return 0