Skip to content

Commit cd448d4

Browse files
committed
Name param duplication problem solved differently - the name must be stored on the object for identification of a player's entities to work
1 parent 09175a2 commit cd448d4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Scalatron/src/scalatron/botwar/Board.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ case class Board(
7676
def addBotThatIsMaster(pos: XY, creationTime: Time, controlFunction: (String => String), plugin: Plugin) : Board =
7777
copy(nextId = nextId + 1, bots = bots.updated(nextId,
7878
Bot(nextId, pos, XY.One, creationTime, Time.SomtimeInThePast, Constants.Energy.Initial,
79-
Bot.Player(controlFunction, plugin, Bot.MasterGeneration, nextId, (0,2), 0L, "", Iterable.empty, Map())
80-
)))
79+
Bot.Player(controlFunction, plugin, Bot.MasterGeneration, nextId, (0,2), 0L, "", Iterable.empty, Map(Protocol.PropertyName.Name -> plugin.name))
80+
)))
8181

8282
def sprinkle(count: Int, rnd: Random, creationTime: Time, boardSize: XY, variety: Bot.Variety) =
8383
(this /: (0 until count))((sum,n) => sum.addBot(sum.emptyRandomPos(rnd, boardSize), XY.One, creationTime, variety))

Scalatron/src/scalatron/botwar/Entity.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ object Bot {
156156
val controlFunctionInput =
157157
Protocol.ServerOpcode.React + "(" +
158158
Protocol.PropertyName.Generation + "=" + generation + "," + "" +
159-
Protocol.PropertyName.Name + "=" + name + "," + "" +
160159
Protocol.PropertyName.Time + "=" + state.time + "," +
161160
Protocol.PropertyName.View + "=" + renderedView + "," +
162161
maybeMasterParameter +

0 commit comments

Comments
 (0)