//TODO: public List <Tile> TargetLine(Direction facing, Vector2 _coord) { List <Tile> Line = new List <Tile>(); switch (facing) { case Direction.Up: break; case Direction.Right: break; case Direction.Down: break; case Direction.Left: break; } return(Line); }
//TODO: public List <Tile> TargetCrossAt(Direction facing, Vector2 _coord, int distance) { List <Tile> cross = new List <Tile>(); switch (facing) { case Direction.Up: break; case Direction.Right: break; case Direction.Down: break; case Direction.Left: break; } return(cross); }
//TODO: public Tile TargetCellAt(Direction facing, Vector2 _coord, int distance) { switch (facing) { case Direction.Up: return(GetUpTile(_coord)); case Direction.Right: return(GetRightTile(_coord)); case Direction.Down: return(GetDownTile(_coord)); case Direction.Left: return(GetLeftTile(_coord)); } return(null); }
public List <Tile> TargetFrontTriangle(Direction facing, Vector2 _coord) { List <Tile> triangle = new List <Tile>(); Tile t = null; Vector2 tempCoord = new Vector2(); switch (facing) { case Direction.Up: //UP t = GetUpTile(_coord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x, _coord.y - 1); } //UP, UP t = GetUpTile(tempCoord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x, _coord.y - 2); } //UP, R t = GetRightTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } //UP, L t = GetLeftTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } break; case Direction.Right: //R t = GetRightTile(_coord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x + 1, _coord.y); } //R, R t = GetRightTile(tempCoord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x + 2, _coord.y); } //R, UP t = GetUpTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } //R, DOWN t = GetDownTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } break; case Direction.Down: //DOWN t = GetDownTile(_coord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x, _coord.y + 1); } //DOWN, DOWN t = GetDownTile(tempCoord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x, _coord.y + 2); } //DOWN, R t = GetRightTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } //DOWN, L t = GetLeftTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } break; case Direction.Left: //L t = GetLeftTile(_coord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x - 1, _coord.y); } //L, L t = GetLeftTile(tempCoord); if (t != null && !t.isBlocked) { tempCoord = t.coord; triangle.Add(t); } else { tempCoord = new Vector2(_coord.x - 2, _coord.y); } //L, UP t = GetUpTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } //L, DOWN t = GetDownTile(tempCoord); if (t != null && !t.isBlocked) { triangle.Add(t); } break; } return(triangle); }