예제 #1
0
 public T this[Coord c]
 {
     get { return(array[(c.z - rect.offset.z) * rect.size.x + c.x - rect.offset.x]); }
     set { array[(c.z - rect.offset.z) * rect.size.x + c.x - rect.offset.x] = value; }
 }
예제 #2
0
 public bool CheckInRange(Coord coord)
 {
     return(coord.x >= offset.x && coord.x < offset.x + size.x &&
            coord.z >= offset.z && coord.z < offset.z + size.z);
 }
예제 #3
0
 public bool CheckInRangeAndBounds(Coord coord)
 {
     return(coord.x > offset.x && coord.x < offset.x + size.x - 1 &&
            coord.z > offset.z && coord.z < offset.z + size.z - 1);
 }
예제 #4
0
 public CoordRect(Rect r)
 {
     offset = new Coord((int)r.x, (int)r.y); size = new Coord((int)r.width, (int)r.height);
 }
예제 #5
0
 public CoordRect(float offsetX, float offsetZ, float sizeX, float sizeZ)
 {
     this.offset = new Coord((int)offsetX, (int)offsetZ); this.size = new Coord((int)sizeX, (int)sizeZ);
 }
예제 #6
0
 public CoordRect(int offsetX, int offsetZ, int sizeX, int sizeZ)
 {
     this.offset = new Coord(offsetX, offsetZ); this.size = new Coord(sizeX, sizeZ);
 }
예제 #7
0
        //public int radius; //not related with size, because a clamped CoordRect should have non-changed radius

        public CoordRect(Coord offset, Coord size)
        {
            this.offset = offset; this.size = size;
        }
예제 #8
0
 public static Coord PickCell(Coord c, int cellRes)
 {
     return(PickCell(c.x, c.z, cellRes));
 }