comparison orpg/mapper/fog_msg.py @ 71:449a8900f9ac ornery-dev

Code refining almost completed, for this round. Some included files are still in need of some clean up, but this is test worthy.
author sirebral
date Thu, 20 Aug 2009 03:00:39 -0500
parents 072ffc1d466f
children 36919b8a3ef9
comparison
equal deleted inserted replaced
70:52a5fa913008 71:449a8900f9ac
69 69
70 def get_changed_xml(self,action="update",output_action=1): 70 def get_changed_xml(self,action="update",output_action=1):
71 return self.toxml(action,output_action) 71 return self.toxml(action,output_action)
72 72
73 def toxml(self,action,output_action): 73 def toxml(self,action,output_action):
74 #print "fog_msg.toxml called"
75 #print "use_fog :",self.use_fog
76 #print "output_action :",output_action
77 #print "action :",action
78 if not (self.use_fog): return "" 74 if not (self.use_fog): return ""
79 fog_string = "" 75 fog_string = ""
80 if self.fogregion.isEmpty(): fog_string=self.get_line("all","del",output_action) 76 if self.fogregion.isEmpty(): fog_string=self.get_line("all","del",output_action)
81 for ri in self.fogregion.GetRectList(): 77 for ri in self.fogregion.GetRectList():
82 x1=ri.GetX() 78 x1=ri.GetX()
114 else: 110 else:
115 polyline=[] 111 polyline=[]
116 list = l._get_childNodes() 112 list = l._get_childNodes()
117 for node in list: 113 for node in list:
118 polyline.append( IPoint().make( int(node.getAttribute("x")), int(node.getAttribute("y")) ) ) 114 polyline.append( IPoint().make( int(node.getAttribute("x")), int(node.getAttribute("y")) ) )
119 # pointarray = outline.split(";") 115 # pointarray = outline.split(";")
120 # for m in range(len(pointarray)): 116 # for m in range(len(pointarray)):
121 # pt=pointarray[m].split(",") 117 # pt=pointarray[m].split(",")
122 # polyline.append(IPoint().make(int(pt[0]),int(pt[1]))) 118 # polyline.append(IPoint().make(int(pt[0]),int(pt[1])))
123 #print "length of polyline", len(polyline) 119 #print "length of polyline", len(polyline)
124 if (len(polyline)>2): 120 if (len(polyline)>2):
125 if action=="del": self.fogregion.FromPolygon(polyline,0) 121 if action=="del": self.fogregion.FromPolygon(polyline,0)
126 else: self.fogregion.FromPolygon(polyline,1) 122 else: self.fogregion.FromPolygon(polyline,1)
127 123
128 def init_from_dom(self,xml_dom): 124 def init_from_dom(self,xml_dom):