private int ShowSphere(int x, int y, int effect) { int minX = To.GetX() - 1; int maxX = To.GetX() + 1; int minY = To.GetY() - 1; int maxY = To.GetY() + 1; if (x >= minX && x <= maxX && y >= minY && y <= maxY) { return(effect); } return(0); }
public Location GetWithYinline() { ICoordinate pivot = this.Coordinates.ElementAt(2); IEnumerable <ICoordinate> coordinates = new List <ICoordinate>() { new Coordinate(pivot.GetX() - 2, pivot.GetY()), new Coordinate(pivot.GetX() - 1, pivot.GetY()), new Coordinate(pivot.GetX(), pivot.GetY()), new Coordinate(pivot.GetX() + 1, pivot.GetY()), new Coordinate(pivot.GetX() + 2, pivot.GetY()) }; return(new Location(coordinates)); }
private ICoordinate GetNewMissilePosition() { int newX = GetNewPosition(Missile.GetX(), To.GetX()); int newY = GetNewPosition(Missile.GetY(), To.GetY()); return(new Coordinate(newX, newY)); }
public bool CanInclude(ICoordinate position) { int x = position.GetX(), y = position.GetY(); if (x > -1 && y > -1 && x < xSize && y < ySize) { return(true); } else { return(false); } }
private ICoordinate TakeShot(Tuple <IKanon, IRadar> weaponcombi) { IRadar radar = weaponcombi.Item2; IKanon canon = weaponcombi.Item1; if (radar != null) { ICoordinate givenTarget = GetRandomShipCoordinate(); ICoordinate target = radar.Parse(givenTarget.GetX(), givenTarget.GetY()); return(canon.Fire(target)); } else { return(canon.Fire()); } }
public static bool AreSame(ICoordinate a, ICoordinate b) { return(a.GetX() == b.GetX() && a.GetY() == b.GetY()); }
private ICoordinate MoveWest(ICoordinate from) { var to = new Coordinate(from.GetX() - 1, from.GetY()); return(to); }
private ICoordinate MoveSouth(ICoordinate from) { var to = new Coordinate(from.GetX(), from.GetY() + 1); return(to); }
// Omdat de interface al is vrijgegeven deze methode hier opnemen // Hoort in de ICoordinate-interface thuis: Equals private bool AreSame(ICoordinate a, ICoordinate b) { return(a.GetX() == b.GetX() && a.GetY() == b.GetY()); }
void Move(ICoordinate to) { x = to.GetX(); y = to.GetY(); z = to.GetZ(); }
public bool Equal(ICoordinate coordinate) { return(x == coordinate.GetX() && y == coordinate.GetY()); }