@@ -109,8 +109,8 @@ def path(self):
109109 return self ._path
110110
111111 def _precache (self ):
112- """Precache the path ."""
113- self . _precache_method ( self . _path , self . _preload )
112+ """Precache the file ."""
113+ raise NotImplementedError ( 'Must be implemented by a subclass.' )
114114
115115 def _server_spawn (self , game_event ):
116116 """Precache the object on map change."""
@@ -133,31 +133,32 @@ def precache_table(self):
133133 """
134134 raise NotImplementedError ('No precache_table defined for class.' )
135135
136- @property
137- def _precache_method (self ):
138- """Return a method to precache the file."""
139- raise NotImplementedError ('No _precache_method defined for class.' )
140-
141136
142137class Decal (_PrecacheBase ):
143138 """Class used to handle a specific decal."""
144139
145140 # Set the base attributes
146141 precache_table = 'decalprecache'
147- _precache_method = engine_server .precache_decal
142+
143+ def _precache (self ):
144+ return engine_server .precache_decal (self ._path , self ._preload )
148145
149146
150147class Generic (_PrecacheBase ):
151148 """Class used to handle generic precaching."""
152149
153150 # Set the base attributes
154151 precache_table = 'genericprecache'
155- _precache_method = engine_server .precache_generic
152+
153+ def _precache (self ):
154+ return engine_server .precache_generic (self ._path , self ._preload )
156155
157156
158157class Model (_PrecacheBase ):
159158 """Class used to handle a specific model."""
160159
161160 # Set the base attributes
162161 precache_table = 'modelprecache'
163- _precache_method = engine_server .precache_model
162+
163+ def _precache (self ):
164+ return engine_server .precache_model (self ._path , self ._preload )
0 commit comments