ArkaliaCore.Game.Game.Engines.PathEngine.NextCell C# (CSharp) Method

NextCell() public method

Get next cell in dir
public NextCell ( int cell, int dir ) : int
cell int
dir int
return int
        public int NextCell(int cell, int dir)
        {
            switch (dir)
            {
                case 0:
                    return cell + 1;

                case 1:
                    return cell + this._map.Width;

                case 2:
                    return cell + (this._map.Width * 2) - 1;

                case 3:
                    return cell + this._map.Width - 1;

                case 4:
                    return cell - 1;

                case 5:
                    return cell - this._map.Width;

                case 6:
                    return cell - (this._map.Width * 2) + 1;

                case 7:
                    return cell - this._map.Width + 1;

            }
            return -1;
        }