private void Init() { alive = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}", Constants.playerBasePath, Constants.SelectedShip, Constants.imageExtension)); hit = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}{3}", Constants.playerBasePath, Constants.SelectedShip, "Hit", Constants.imageExtension)); selectedAlive = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}{3}", Constants.playerBasePath, Constants.SelectedShip, "Selected", Constants.imageExtension)); selectedHit = new Ship(Constants.ObjectSize, Constants.ObjectSize, String.Format("{0}{1}{2}{3}", Constants.playerBasePath, Constants.SelectedShip, "SelectedHit", Constants.imageExtension)); }
public Player(double x, double y, int id) : base(x, y, Constants.ObjectSize, Constants.ObjectSize, false) { this.id = id; Init(); currentShip = alive; }
public void CheckSelection() { if (selected) { if (GetObjectState() == Constants.ObjectState.Hit) currentShip = selectedHit; if (GetObjectState() == Constants.ObjectState.Alive) currentShip = selectedAlive; return; } if (!selected) { if (GetObjectState() == Constants.ObjectState.Hit) currentShip = hit; if (GetObjectState() == Constants.ObjectState.Alive) currentShip = alive;return; } }