コード例 #1
0
    private void Initialize(TileProperties[,] tileProperties, int size)
    {
        this.tileSize     = size;
        this.halfTileSize = this.tileSize / 2f;
        this.Width        = tileProperties.GetUpperBound(0) + 1;
        this.Height       = tileProperties.GetUpperBound(1) + 1;
        this.actorToPoint = new Dictionary <Actor, Vector2i>();
        this.pointToActor = new Dictionary <Vector2i, Actor>();

        this.Tiles = new Tile[this.Width, this.Height];
        for (int ii = 0; ii < this.Width; ii++)
        {
            for (int jj = 0; jj < this.Height; jj++)
            {
                var tile = new Tile(tileProperties[ii, jj]);
                tile.x             = ii * this.tileSize + this.tileSize / 2;
                tile.y             = jj * this.tileSize + this.tileSize / 2;
                tile.width         = tile.height = this.tileSize;
                this.Tiles[ii, jj] = tile;
            }
        }

        this.mouseManager = new MouseManager(this);

        this.tileInterface = new TileInterface(this);
    }
コード例 #2
0
ファイル: Map.cs プロジェクト: HaKDMoDz/awayteam
    private void Initialize(TileProperties[,] tileProperties, int size)
    {
        this.tileSize = size;
        this.halfTileSize = this.tileSize / 2f;
        this.Width = tileProperties.GetUpperBound(0) + 1;
        this.Height = tileProperties.GetUpperBound(1) + 1;
        this.actorToPoint = new Dictionary<Actor, Vector2i>();
        this.pointToActor = new Dictionary<Vector2i, Actor>();

        this.Tiles = new Tile[this.Width, this.Height];
        for (int ii = 0; ii < this.Width; ii++)
        {
            for (int jj = 0; jj < this.Height; jj++)
            {
                var tile = new Tile(tileProperties[ii,jj]);
                tile.x = ii * this.tileSize + this.tileSize / 2;
                tile.y = jj * this.tileSize + this.tileSize / 2;
                tile.width = tile.height = this.tileSize;
                this.Tiles[ii, jj] = tile;
            }
        }

        this.mouseManager = new MouseManager(this);

        this.tileInterface = new TileInterface(this);
    }