Exemplo n.º 1
0
 public IHex GetPushTile(IHex source, IHex target)
 {
     if (source != null && target != null)
     {
         if (source.IsTileN(target, 1))
         {
             return(target.GetN());
         }
         else if (source.IsTileNE(target, 1))
         {
             return(target.GetNE());
         }
         else if (source.IsTileSE(target, 1))
         {
             return(target.GetSE());
         }
         else if (source.IsTileS(target, 1))
         {
             return(target.GetS());
         }
         else if (source.IsTileSW(target, 1))
         {
             return(target.GetSW());
         }
         else if (source.IsTileNW(target, 1))
         {
             return(target.GetNW());
         }
     }
     return(null);
 }
Exemplo n.º 2
0
        public List <IHex> GetArcTiles(IHex source, IHex target)
        {
            List <IHex> tiles = new List <IHex>();

            if (source != null && target != null)
            {
                if (source.IsTileN(target, 1))
                {
                    if (source.GetNE() != null)
                    {
                        tiles.Add(source.GetNE());
                    }
                    if (source.GetNW() != null)
                    {
                        tiles.Add(source.GetNW());
                    }
                    tiles.Add(target);
                }
                else if (source.IsTileNE(target, 1))
                {
                    if (source.GetN() != null)
                    {
                        tiles.Add(source.GetN());
                    }
                    if (source.GetSE() != null)
                    {
                        tiles.Add(source.GetSE());
                    }
                    tiles.Add(target);
                }
                else if (source.IsTileSE(target, 1))
                {
                    if (source.GetNE() != null)
                    {
                        tiles.Add(source.GetNE());
                    }
                    if (source.GetS() != null)
                    {
                        tiles.Add(source.GetS());
                    }
                    tiles.Add(target);
                }
                else if (source.IsTileS(target, 1))
                {
                    if (source.GetSE() != null)
                    {
                        tiles.Add(source.GetSE());
                    }
                    if (source.GetSW() != null)
                    {
                        tiles.Add(source.GetSW());
                    }
                    tiles.Add(target);
                }
                else if (source.IsTileSW(target, 1))
                {
                    if (source.GetS() != null)
                    {
                        tiles.Add(source.GetS());
                    }
                    if (source.GetNW() != null)
                    {
                        tiles.Add(source.GetNW());
                    }
                    tiles.Add(target);
                }
                else if (source.IsTileNW(target, 1))
                {
                    if (source.GetSW() != null)
                    {
                        tiles.Add(source.GetSW());
                    }
                    if (source.GetN() != null)
                    {
                        tiles.Add(source.GetN());
                    }
                    tiles.Add(target);
                }
            }
            return(tiles);
        }