|
@@ -5,27 +5,39 @@ using UnityEngine;
|
|
|
|
|
|
namespace FrameWorkDesign.Example
|
|
|
{
|
|
|
- public class GameModel
|
|
|
+ public interface IGameModel
|
|
|
{
|
|
|
- public static BindableProperty<int> killCount = new BindableProperty<int>()
|
|
|
+
|
|
|
+ BindableProperty<int> killCount { get; }
|
|
|
+
|
|
|
+ BindableProperty<int> Gold { get; }
|
|
|
+
|
|
|
+ BindableProperty<int> Score { get; }
|
|
|
+
|
|
|
+ BindableProperty<int> BestScore { get; }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ public class GameModel : IGameModel
|
|
|
+ {
|
|
|
+ public BindableProperty<int> killCount { get; } = new BindableProperty<int>()
|
|
|
{
|
|
|
Value = 0
|
|
|
};
|
|
|
|
|
|
- public static BindableProperty<int> Gold = new BindableProperty<int>()
|
|
|
+ public BindableProperty<int> Gold { get; } = new BindableProperty<int>()
|
|
|
{
|
|
|
Value = 0
|
|
|
};
|
|
|
|
|
|
- public static BindableProperty<int> Score = new BindableProperty<int>()
|
|
|
+ public BindableProperty<int> Score { get; } = new BindableProperty<int>()
|
|
|
{
|
|
|
Value = 0
|
|
|
};
|
|
|
|
|
|
- public static BindableProperty<int> BestScore = new BindableProperty<int>()
|
|
|
+ public BindableProperty<int> BestScore { get; } = new BindableProperty<int>()
|
|
|
{
|
|
|
Value = 0
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
}
|