@@ -6,9 +6,10 @@ package scalatron.botwar
6
6
import renderer .Renderer
7
7
import scalatron .botwar .BotWarSimulation .SimState
8
8
import java .awt .event .{WindowEvent , WindowAdapter , KeyEvent , KeyListener }
9
+ import scalatron .scalatron .api .Scalatron
10
+ import scalatron .scalatron .impl .{TournamentRoundResult , TournamentState , Plugin , PluginCollection , Game }
9
11
import akka .dispatch .ExecutionContext
10
12
import akka .actor .ActorSystem
11
- import scalatron .core ._
12
13
13
14
14
15
/** BotWar: an implementation of the Scalatron Game trait.
@@ -17,7 +18,12 @@ case object BotWar extends Game
17
18
{
18
19
val name = Constants .GameName
19
20
20
- def gameSpecificPackagePath = " scalatron.botwar.botPlugin"
21
+ val pluginLoadSpec =
22
+ PluginCollection .LoadSpec (
23
+ Scalatron .Constants .JarFilename , // "ScalatronBot.jar"
24
+ " scalatron.botwar.botPlugin" ,
25
+ " ControlFunctionFactory" )
26
+
21
27
22
28
def runVisually (
23
29
pluginPath : String ,
@@ -89,7 +95,7 @@ case object BotWar extends Game
89
95
}
90
96
91
97
92
- var pluginCollection = PluginCollection (pluginPath, gameSpecificPackagePath , verbose)
98
+ var pluginCollection = PluginCollection (pluginPath, pluginLoadSpec , verbose)
93
99
94
100
// now perform game runs ad infinitum
95
101
var roundIndex = 0
@@ -160,7 +166,7 @@ case object BotWar extends Game
160
166
tournamentState.addResult(tournamentRoundResult)
161
167
}
162
168
163
- var pluginCollection = PluginCollection (pluginPath, gameSpecificPackagePath , verbose)
169
+ var pluginCollection = PluginCollection (pluginPath, pluginLoadSpec , verbose)
164
170
165
171
// now perform game runs ad infinitum
166
172
var roundIndex = 0
@@ -202,7 +208,7 @@ case object BotWar extends Game
202
208
* @return the initial simulation state
203
209
*/
204
210
def startHeadless (
205
- plugins : Iterable [Plugin .FromJarFile ],
211
+ plugins : Iterable [Plugin .External ],
206
212
secureMode : Boolean ,
207
213
argMap : Map [String ,String ]
208
214
)(
@@ -234,7 +240,7 @@ case object BotWar extends Game
234
240
* @return the initial simulation state
235
241
*/
236
242
def startHeadless (
237
- plugins : Iterable [Plugin .FromJarFile ],
243
+ plugins : Iterable [Plugin .External ],
238
244
permanentConfig : PermanentConfig ,
239
245
gameConfig : Config
240
246
)(
0 commit comments