public Map(PokeEngine engine, int id) { this.engine = engine; this.mapid = id; entities = new List<Entity>(); initialize(id); if (!(this is MapConnection)) { if (MapProvider.getInstance().getConnections(id) != null) { foreach (ConnectionInfo info in MapProvider.getInstance().getConnections(id)) { if (info.dir == ConnectionDirection.LEFT) { connectionLeft = info.createConnectionFromInfo(this); } else if (info.dir == ConnectionDirection.UP) { connectionUp = info.createConnectionFromInfo(this); } else if (info.dir == ConnectionDirection.RIGHT) { connectionRight = info.createConnectionFromInfo(this); } else if (info.dir == ConnectionDirection.DOWN) { connectionDown = info.createConnectionFromInfo(this); } } } /*connectionLeft = new MapConnection(engine, this, ConnectionDirection.LEFT, 2, 0); connectionUp = new MapConnection(engine, this, ConnectionDirection.UP, 2, 0); connectionRight = new MapConnection(engine, this, ConnectionDirection.RIGHT, 2, 1); connectionDown = new MapConnection(engine, this, ConnectionDirection.DOWN, 2, 0);*/ } }
public MapConnection createConnectionFromInfo(Map parent) { MapConnection result = new MapConnection(PokeEngine.instance, parent, dir, id, offset); return result; }
public MapConnection createConnectionFromInfo(Map parent) { MapConnection result = new MapConnection(PokeEngine.instance, parent, dir, id, offset); return(result); }