private Light[,] MakeLights(int rows, int columns) { var lights = new Light[rows,columns]; int heightPerLight = Height / rows; int widthPerLight = Width / columns; for (int row = 0; row < rows; row++) for (int column = 0; column < columns; column++) { var light = new Light(row, column, heightPerLight, widthPerLight, false); lights[row, column] = light; Controls.Add(light); } return lights; }
public Player(Map map) : base('@', TCODColor.green) { CurrentMap = map; Light = new Light(0, 0, 0); _inventory = new Inventory(this); _inventory.Add(new ItemsData.TorchLight()); Equip(Inventory.GetAtLetter('a')); for (int i = 0; i < 5; i++) { _inventory.Add(new ItemsData.WeakTorch()); } _inventory.Add(new ItemsData.FlashScroll()); _inventory.Add(new ItemsData.FlashScroll()); _inventory.Add(new ItemsData.FlashScroll()); }
public void LightClicked(Light light) { if (!Solved) { light.Toggle(); //neighbours //above if (light.Row > 0) Lights[light.Row - 1, light.Column].Toggle(); //below if (light.Row < Rows - 1) Lights[light.Row + 1, light.Column].Toggle(); //left if (light.Column > 0) Lights[light.Row, light.Column - 1].Toggle(); //right if (light.Column < Columns - 1) Lights[light.Row, light.Column + 1].Toggle(); } }
public void SetLight(Light light) { Light = light; IsLight = true; LightOn = true; }
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); }
public void RemoveLight(Light light) { light.RemoveFromMap(); _deadLights.Add(light); }
public void AddLight(Light light) { _lights.Add(light); }