mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
added cellWidth as a required field of CartesianGrids
This commit is contained in:
parent
95e30464a6
commit
c390bb15ba
@ -52,6 +52,9 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
|
||||
# If this distributed object is a DistributedGrid return 1. 0 by default
|
||||
return 1
|
||||
|
||||
def setCellWidth(self, width):
|
||||
self.cellWidth = width
|
||||
|
||||
def setParentingRules(self, style, rule):
|
||||
assert self.notify.debug("setParentingRules: style: %s, rule: %s" % (style, rule))
|
||||
rules = rule.split(self.RuleSeparator)
|
||||
|
@ -10,13 +10,14 @@ class DistributedCartesianGridAI(DistributedNodeAI, CartesianGridBase):
|
||||
|
||||
RuleSeparator = ":"
|
||||
|
||||
def __init__(self, air, startingZone, gridSize, gridRadius,
|
||||
def __init__(self, air, startingZone, gridSize, gridRadius, cellWidth,
|
||||
style="Cartesian"):
|
||||
DistributedNodeAI.__init__(self, air)
|
||||
self.style = style
|
||||
self.startingZone = startingZone
|
||||
self.gridSize = gridSize
|
||||
self.gridRadius = gridRadius
|
||||
self.cellWidth = cellWidth
|
||||
|
||||
# Keep track of all AI objects added to the grid
|
||||
self.gridObjects = {}
|
||||
@ -31,6 +32,9 @@ class DistributedCartesianGridAI(DistributedNodeAI, CartesianGridBase):
|
||||
# 0 by default
|
||||
return 1
|
||||
|
||||
def getCellWidth(self):
|
||||
return self.cellWidth
|
||||
|
||||
def getParentingRules(self):
|
||||
self.notify.debug("calling getter")
|
||||
rule = ("%i%s%i%s%i" % (self.startingZone, self.RuleSeparator,
|
||||
|
Loading…
x
Reference in New Issue
Block a user