else if ((Field[CurX + dx, CurY + dy] == BOULDER) & (Field[CurX + 2 * dx][CurY + 2 * dy] == SPACE))
public void RedrawField(Graphics graphics, Rectangle clientRect, ImageList imageList)
{
graphics.FillRectangle(Brushes.White, clientRect);
imageList.Draw(graphics, 1, 1, 0);
}
private readonly object e;
private void Form1_Paint(string filename)
{
RedrawField();
}
RedrawField();
if (Positioned == N_of_places) {
MessageBox.Show('Уровень пройден!', 'Sokoban', MessageBoxButtons.OK);
}
как минимум += -= не работают с обычными делегатами
static void Main(string[] args)
{
Action<string> log = null;
log += LogToFile;
log += LogToConsole;
log("done");
}
public static void LogToFile(string msg)
{
Console.WriteLine($"file: {msg}");
}
public static void LogToConsole(string msg)
{
Console.WriteLine($"con: {msg}");
}
объяснить почему AddListener работает так как я хочу,
private void FindRef(int index, ref Action<Entity> value)
{
value = ref _list[index].Action;
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
// заполняет фон формы белым цветом
e.Graphics.FillRectangle(Brushes.White, ClientRectangle);
// рисует картинку с нулевым индексом по координате (1, 1)
imageList1.Draw(e.Graphics, 1, 1, 0);
}
объявление переменной