コード例 #1
0
ファイル: Map.cs プロジェクト: ryancheung/WinWar
        /// <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();
        }
コード例 #2
0
 // LevelVisualResource(setData, setOffset)
 internal void FillAStar(AStar2D astar)
 {
     astar.SetField (passableData, width, height);
 }
コード例 #3
0
ファイル: Map.cs プロジェクト: CAMongrel/WinWar
        /// <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 ();
        }