38 lines
812 B
C#
38 lines
812 B
C#
|
using System;
|
|||
|
using System.ComponentModel;
|
|||
|
|
|||
|
namespace Tetris.Models;
|
|||
|
|
|||
|
public class Party : INotifyPropertyChanged {
|
|||
|
public event PropertyChangedEventHandler PropertyChanged;
|
|||
|
|
|||
|
private String _userName;
|
|||
|
|
|||
|
public String UserName {
|
|||
|
get => _userName;
|
|||
|
set {
|
|||
|
_userName = value;
|
|||
|
OnPropertyChanged("UserName");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
private int _score = 0;
|
|||
|
|
|||
|
public int Score {
|
|||
|
get => _score;
|
|||
|
set {
|
|||
|
_score = value;
|
|||
|
OnPropertyChanged("Score");
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public Party(String userName) {
|
|||
|
_userName = userName;
|
|||
|
}
|
|||
|
|
|||
|
protected virtual void OnPropertyChanged(string propertyName) {
|
|||
|
if (PropertyChanged != null)
|
|||
|
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
|||
|
}
|
|||
|
}
|