//--------------------------------------------------------------- //SHIP ON MAP ON CLICK //--------------------------------------------------------------- private bool ShipOnMapClick(ShipOnMap sender, MouseState ms) { return IsHigher(sender.ToIDraw(), ms); }
//--------------------------------------------------------------- //SHIP SYSTEM QUIT //--------------------------------------------------------------- private void ShipSystemQuit(Ship sender) { Texture2D texture = Content.Load<Texture2D>("LittleStars/ShipOnMap"); Texture2D circle = Content.Load<Texture2D>("LittleStars/CurrentPlayerCircle"); StarOnMap SOM = FindStarOnMapWithThisObject(sender); List<Ship> ships = new List<Ship>(); ships.Add(sender); Vector2 position = new Vector2(SOM.Position.X + SOM.Width + 5, SOM.Position.Y + SOM.Height + 5); ShipOnMap temp = new ShipOnMap(texture, circle, position, new Vector2(Scales.FourTenth), ships); sender.OnClick -= ShipOnClick; sender.OnRightButtonClick -= ShipRightButtonClick; sender.OnSystemQuit -= ShipSystemQuit; screens["GalaxyMap"].Objects["Map"].ToMap().Objects.Add(temp.ToIDraw()); screens["SolarSystem"].Objects["SolarSystem"].ToSolarSystem().Objects.Remove(sender.ToIDraw()); //screens["SolarSystem"].Objects["SolarSystem"].ToSolarSystem().Objects = screens["SolarSystem"].Objects["SolarSystem"].ToSolarSystem().Objects.ToList<IDraw>(); }