Example #1
0
 public static Tuple <int, int> Distance(TileObject t1, TileObject t2)
 {
     return(new Tuple <int, int>
                ((t2.CurrentIndex.Item1 - t1.CurrentIndex.Item1), (t2.CurrentIndex.Item2 - t1.CurrentIndex.Item2)));
 }
Example #2
0
        public static int MaxDistance(TileObject t1, TileObject t2)
        {
            var dis = AbsDistance(t1, t2);

            return(dis.Item1 > dis.Item2 ? dis.Item1 : dis.Item2);
        }
Example #3
0
 public static Tuple <int, int> AbsDistance(TileObject t1, TileObject t2)
 {
     return(new Tuple <int, int>
                (Mathf.Abs(t1.CurrentIndex.Item1 - t2.CurrentIndex.Item1), Mathf.Abs(t1.CurrentIndex.Item2 - t2.CurrentIndex.Item2)));
 }
Example #4
0
 private void Awake()
 {
     _tileObject = GetComponent <TileObject>();
     _grid       = FindObjectOfType <Grid>();
 }
Example #5
0
 public Tuple <int, int> Distance(TileObject tileObj)
 {
     return(new Tuple <int, int>
                (Mathf.Abs(tileObj.CurrentIndex.Item1 - locale.Item1), Mathf.Abs(tileObj.CurrentIndex.Item2 - locale.Item2)));
 }
Example #6
0
 public int MaxDistance(TileObject tileObj)
 {
     return(Mathf.Abs(tileObj.CurrentIndex.Item1 - locale.Item1) > Mathf.Abs(tileObj.CurrentIndex.Item2 - locale.Item2) ?
            Mathf.Abs(tileObj.CurrentIndex.Item1 - locale.Item1) : Mathf.Abs(tileObj.CurrentIndex.Item2 - locale.Item2));
 }
Example #7
0
 public void Release()
 {
     _occupator.tile = null;
     _occupator      = null;
 }