Exemplo n.º 1
0
        /// <summary>
        /// Create map
        /// </summary>
        internal Map(LevelInfoResource setLevelInfo,
                     LevelVisualResource setLevelVisual,
                     LevelPassableResource setLevelPassable)
        {
            OnSelectedEntitiesChanged = null;

            selectedEntities = new List <Entity>();

            TileWidth  = 16;
            TileHeight = 16;

            MapWidth  = 64;
            MapHeight = 64;

            levelInfo     = setLevelInfo;
            levelVisual   = setLevelVisual;
            levelPassable = setLevelPassable;

            mapDiscoverState = new MapDiscover[MapWidth * MapHeight];

            tileSet = MapTileset.GetTileset((int)levelInfo.TilesetResourceIndex);

            Players = new List <BasePlayer>();
            AddPlayers();

            Rnd = new Random();

            Pathfinder = new AStar2D();
        }
Exemplo n.º 2
0
 // LevelVisualResource(setData, setOffset)
 internal void FillAStar(AStar2D astar)
 {
     astar.SetField (passableData, width, height);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Create map
        /// </summary>
        internal Map(LevelInfoResource setLevelInfo, 
               LevelVisualResource setLevelVisual,
               LevelPassableResource setLevelPassable)
        {
            OnSelectedEntitiesChanged = null;

             selectedEntities = new List<Entity>();

             TileWidth = 16;
             TileHeight = 16;

             MapWidth = 64;
             MapHeight = 64;

             levelInfo = setLevelInfo;
             levelVisual = setLevelVisual;
             levelPassable = setLevelPassable;

             mapDiscoverState = new MapDiscover[MapWidth * MapHeight];

             tileSet = MapTileset.GetTileset((int)levelInfo.TilesetResourceIndex);

             Players = new List<BasePlayer> ();
             AddPlayers();

             Rnd = new Random ();

             Pathfinder = new AStar2D ();
        }