📦 andreifilip123 / monopoly-csharp

📄 Celula.cs · 41 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41using System;
using System.Drawing;
using System.Windows.Forms;
using Monopoly.Properties;
using Newtonsoft.Json;

namespace Monopoly
{
    public class Celula : Button
    {
        public int ID { get; set; }
        public string nume { get; set; }
        public Image imagine { get; set; }

        public virtual void activeaza(Jucator jucator)
        {

        }

        [JsonConstructor]
        public Celula(int ID, string nume, string imagine)
        {
            this.ID = ID;
            this.nume = nume;
            this.imagine = (Image)Resources.ResourceManager.GetObject(imagine);
            Click += Celula_Click;
        }

        public Celula()
        {
            //ListaCelule.Instanta.Add(this);
        }

        private void Celula_Click(object sender, EventArgs e)
        {
            new AfisareCelula(imagine);
        }

        public static Comparison<Celula> comparare = (x, y) => x.ID.CompareTo(y.ID);
    }
}