public bool PlaceAt(int x, int y, Map map) { if (x >= 0 && x < Map.MAP_WIDTH && y >= 0 && y < Map.MAP_HEIGHT) { if (!_isOnMap || map != _currentMap) { if (_currentMap != null) { _currentMap.RemoveLight(this); } _currentMap = map; map.AddLight(this); _tcodmap = new TCODMap(Map.MAP_WIDTH, Map.MAP_HEIGHT); _tcodmap.copy(map.TCODMap); } PosX = x; PosY = y; _tcodmap.computeFov(PosX, PosY, _radius, true); _isOnMap = true; return(true); } return(false); }
public virtual void Get() { State = ItemState.Held; Map.RemoveItem(this); if (IsLight) { Map.RemoveLight(Light); } }