mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
added POD.copyTo
This commit is contained in:
parent
efaa58b52f
commit
e225c565b2
@ -1202,7 +1202,7 @@ class POD:
|
|||||||
raise "object '%s' doesn't have value '%s'" % (other, name)
|
raise "object '%s' doesn't have value '%s'" % (other, name)
|
||||||
else:
|
else:
|
||||||
setattr(self, name, self.getDefaultValue(name))
|
setattr(self, name, self.getDefaultValue(name))
|
||||||
# support 'p = POD.POD().copyFrom(other)'
|
# support 'p = POD.POD().copyFrom(other)' syntax
|
||||||
return self
|
return self
|
||||||
def makeCopy(self):
|
def makeCopy(self):
|
||||||
# returns a duplicate of this object
|
# returns a duplicate of this object
|
||||||
@ -1730,6 +1730,11 @@ class Enum:
|
|||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self._stringTable)
|
return len(self._stringTable)
|
||||||
|
|
||||||
|
def copyTo(self, obj):
|
||||||
|
# copies all members onto obj
|
||||||
|
for name, value in self._stringTable:
|
||||||
|
setattr(obj, name, value)
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
def _checkExistingMembers(self, items):
|
def _checkExistingMembers(self, items):
|
||||||
for item in items:
|
for item in items:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user