| | |
| | |
|
| | | class tagCSHeroDismiss(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | Count = 0 #(WORD Count)
|
| | | ItemIndexList = list() #(vector<WORD> ItemIndexList)// 武将物品所在武将背包位置索引列表
|
| | | data = None
|
| | |
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.ItemIndexList.append(value)
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 2
|
| | | length += 2 * self.Count
|
| | |
|
| | | return length
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteWORD(data, self.ItemIndexList[i])
|
| | | return data
|