diff --git a/MHSEC-G/MHSEC-G.sln.DotSettings b/MHSEC-G/MHSEC-G.sln.DotSettings new file mode 100644 index 0000000..2c45d07 --- /dev/null +++ b/MHSEC-G/MHSEC-G.sln.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/MHSEC-G/MHSEC-G/Character.cs b/MHSEC-G/MHSEC-G/Character.cs new file mode 100644 index 0000000..c7da394 --- /dev/null +++ b/MHSEC-G/MHSEC-G/Character.cs @@ -0,0 +1,59 @@ +using System.ComponentModel; +using MHSEC_G.Annotations; + +namespace MHSEC_G +{ + public class Character : INotifyPropertyChanged + { + private const uint OFFSETA_CHAR_NAME = 0x9DA0; + private const uint LENGTH_CHAR_NAME = 6; + private const uint OFFSETA_CHAR_MONEY = 0x5B404; + private const uint OFFSETA_CHAR_EXP = 0x9E68; + private const uint OFFSETA_CHAR_LEVEL = 0x9E64; + + private uint _char_level; + public uint char_level + { + get { return _char_level; } + set { _char_level = value; OnPropertyChanged(nameof(char_level)); } + } + + private uint _char_exp; + public uint char_exp + { + get { return _char_exp; } + set { _char_exp = value; OnPropertyChanged(nameof(char_exp)); } + } + + private uint _char_money; + public uint char_money + { + get { return _char_money; } + set { _char_money = value; OnPropertyChanged(nameof(char_money)); } + } + + private string _char_name; + public string char_name + { + get { return _char_name; } + set { _char_name = value; OnPropertyChanged(nameof(char_name)); } + } + + + public Character(byte[] save_data) + { + _char_level = Model.byte_to_uint(save_data[OFFSETA_CHAR_LEVEL]); + _char_exp = Model.byte_to_uint32_le(save_data, OFFSETA_CHAR_EXP); + _char_money = Model.byte_to_uint32_le(save_data, OFFSETA_CHAR_MONEY); + _char_name = Model.read_unicode_string(save_data, OFFSETA_CHAR_NAME, LENGTH_CHAR_NAME); + } + + public event PropertyChangedEventHandler PropertyChanged; + + [NotifyPropertyChangedInvocator] + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/MHSEC-G/MHSEC-G/View.cs b/MHSEC-G/MHSEC-G/EggFragment.cs similarity index 61% rename from MHSEC-G/MHSEC-G/View.cs rename to MHSEC-G/MHSEC-G/EggFragment.cs index bb6c1e6..567189a 100644 --- a/MHSEC-G/MHSEC-G/View.cs +++ b/MHSEC-G/MHSEC-G/EggFragment.cs @@ -2,12 +2,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; namespace MHSEC_G { - public interface View + class EggFragment { - void update(); } } diff --git a/MHSEC-G/MHSEC-G/Item.cs b/MHSEC-G/MHSEC-G/Item.cs new file mode 100644 index 0000000..72753fe --- /dev/null +++ b/MHSEC-G/MHSEC-G/Item.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MHSEC_G +{ + class Item + { + } +} diff --git a/MHSEC-G/MHSEC-G/MHSEC-G.csproj b/MHSEC-G/MHSEC-G/MHSEC-G.csproj index 79cbbb1..d5d11c7 100644 --- a/MHSEC-G/MHSEC-G/MHSEC-G.csproj +++ b/MHSEC-G/MHSEC-G/MHSEC-G.csproj @@ -36,6 +36,7 @@ + @@ -53,8 +54,13 @@ MSBuild:Compile Designer + + + - + + + MSBuild:Compile Designer diff --git a/MHSEC-G/MHSEC-G/MainWindow.xaml b/MHSEC-G/MHSEC-G/MainWindow.xaml index c0e5caa..3baf02a 100644 --- a/MHSEC-G/MHSEC-G/MainWindow.xaml +++ b/MHSEC-G/MHSEC-G/MainWindow.xaml @@ -15,10 +15,10 @@