Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package messages;
- import map.Fields
- import map.Fields.Castle
- import map.Fields.Grass
- import map.Map
- import java.util.*
- import javax.xml.bind.annotation.XmlAccessType
- import javax.xml.bind.annotation.XmlAccessorType
- import javax.xml.bind.annotation.XmlElement
- import javax.xml.bind.annotation.XmlRootElement
- @XmlRootElement(name = "halfMap")
- @XmlAccessorType(XmlAccessType.FIELD)
- class HalfMap {
- @XmlElement(name = "uniquePlayerID")
- var playerIdentifier: String = ""
- @XmlElement(name = "newMapNode")
- var nodes = ArrayList<NewMapNode>(32);
- constructor()
- constructor(gameID: String, map: Map) {
- playerIdentifier = gameID
- var iter = map.iterator();
- while (iter.hasNext()) {
- nodes.add(NewMapNode(iter.next()));
- }
- }
- };
- class NewMapNode {
- constructor()
- companion object {
- var count = 0
- }
- var x = 0
- var y = 0
- var fortPresent = false
- var terrain = "";
- constructor(fields: Fields?) {
- if (fields != null) {
- if (fields == Castle) {
- fortPresent = true
- terrain = Grass.name
- } else {
- terrain = fields.name
- }
- }
- x = count % 8;
- y = count / 8;
- count++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement