initial commit with first really early version

This commit is contained in:
2022-10-06 09:09:25 +02:00
commit 289747f0e4
18 changed files with 1270 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
namespace NonoGramme
{
internal class Nonogramme : PictureBox
{
const int DEFAULT_GRID_SIZE = 5;
const int DEFAULT_UI_RATIO = 20;
private Size _gridSize;
private Grid _gameGrid;
public Size GridSize { get => _gridSize; set => _gridSize = value; }
internal Grid GameGrid { get => _gameGrid; set => _gameGrid = value; }
public Nonogramme()
{
GameGrid = new Grid(new Size(DEFAULT_GRID_SIZE,DEFAULT_GRID_SIZE));
}
public void NewGame(Size gridSize)
{
GameGrid = new Grid(gridSize);
}
public override void Refresh()
{
base.Refresh();
Bitmap bmp = new Bitmap(Width, Height);
this.Image = GameGrid.Draw(bmp, new Point((Width / 100) * DEFAULT_UI_RATIO, (Height / 100) * DEFAULT_UI_RATIO));
}
}
}