Example #1
0
 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;
 }
Example #2
0
 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());
 }
Example #3
0
        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();
            }
        }
Example #4
0
 public void SetLight(Light light)
 {
     Light = light;
     IsLight = true;
     LightOn = true;
 }
Example #5
0
 public override void Use()
 {
     Light l = new Light(200, 200, 2);
     l.PlaceAt(Map.Player.PosX, Map.Player.PosY, Map);
 }
Example #6
0
 void SetLight(Light light)
 {
     Light = light;
     light.PlaceAt(PosX, PosY, CurrentMap);
 }
Example #7
0
 public void RemoveLight(Light light)
 {
     light.RemoveFromMap();
     _deadLights.Add(light);
 }
Example #8
0
 public void AddLight(Light light)
 {
     _lights.Add(light);
 }