1 Star 8 Fork 4

不懂d叛逆/pyccjh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ccjhContainer.py 1008 Bytes
一键复制 编辑 原始数据 按行查看 历史
不懂d叛逆 提交于 2015-02-06 17:03 +08:00 . \r\n替换为\n
# -*- coding: utf-8 -*-
'''
Created on 2013-6-1
容器类
@author: 不懂d叛逆
'''
import ccjhMan, ccjhObj
class ccjhContainer(ccjhObj.ccjhObj):
def __init__(self):
self.items = {}
self.LongID = 0
return
def ClearItem(self):
self.items.clear()
return
def AddItem(self, obj):
if isinstance(obj, ccjhMan.ccjhMan):
if obj.LongID > 0:
if obj.LongID in self.items:
self.items[obj.LongID].setTo(obj)
# self.debugShowItem()
else:
self.items[obj.LongID] = obj
return
def RemoveItem(self, obj):
if isinstance(obj, int):
del(self.items[obj])
# self.debugShowItem()
def Find(self, nID):
if isinstance(nID, int) and nID in self.items:
return self.items[nID]
return 0
def Contains(self, obj):
return obj.LongID in self.items
def debugShowItem(self):
for (k, v) in self.items.items():
print("场景", k, v.ToString())
return
def FindByID(self, idString):
for v in self.items.values():
if v.get("I") == idString:
return v
return 0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/panlizzx/pyccjh.git
git@gitee.com:panlizzx/pyccjh.git
panlizzx
pyccjh
pyccjh
master

搜索帮助