NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

dotApplicationStore.py (1545B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\dotWeapons\common\dotApplicationStore.py
      2 from dotWeapons.common.dotAppsOnTarget import DotAppsOnTarget
      3 
      4 class DotApplicationStore(object):
      5 
      6     def __init__(self, dogmaLM):
      7         self.dogmaLM = dogmaLM
      8         self._dotAppsByTargetID = {}
      9 
     10     def Insert(self, targetItemID, dotApplication):
     11         dotAppsOnTarget = self.GetDotAppsOnTarget(targetItemID)
     12         if not dotAppsOnTarget:
     13             dotAppsOnTarget = DotAppsOnTarget(targetItemID, self.dogmaLM)
     14             self._dotAppsByTargetID[targetItemID] = dotAppsOnTarget
     15         dotAppsOnTarget.AddDotApplication(dotApplication)
     16 
     17     def GetDotAppsOnTarget(self, targetItemID):
     18         dotApplications = self._dotAppsByTargetID.get(targetItemID, None)
     19         return dotApplications
     20 
     21     def IterateApplicationByTargetID(self):
     22         for targetID, dotApplicationsForTarget in self._dotAppsByTargetID.iteritems():
     23             yield (targetID, dotApplicationsForTarget)
     24 
     25     def IsTargetRecored(self, targetID):
     26         return targetID in self._dotAppsByTargetID
     27 
     28     def DoesTargetHaveValidApplication(self, targetID):
     29         dotAppsOnTarget = self.GetDotAppsOnTarget(targetID)
     30         if not dotAppsOnTarget:
     31             return False
     32         return dotAppsOnTarget.HasValidApplications()
     33 
     34     def DeleteAllForTarget(self, targetItemID):
     35         return self._dotAppsByTargetID.pop(targetItemID, None)
     36 
     37     def GetDotApplicationsForAllTargets(self):
     38         return self._dotAppsByTargetID.values()