public virtual bool Drop(int x, int y, Map map) { if (x >= 0 && x < Map.MAP_WIDTH && y >= 0 && y < Map.MAP_HEIGHT) { PosX = x; PosY = y; Map = map; State = ItemState.Dropped; map.AddItem(this); if (IsLight && LightOn) { Light.PlaceAt(x, y, map); } return(true); } return(false); }
public override void Use() { Light l = new Light(200, 200, 2); l.PlaceAt(Map.Player.PosX, Map.Player.PosY, Map); }
void SetLight(Light light) { Light = light; light.PlaceAt(PosX, PosY, CurrentMap); }