예제 #1
0
        private static void RunTrackablePoco()
        {
            Log.WriteLine("***** TrackablePoco (Protobuf) *****");

            var u = new TrackableUserData();

            u.SetDefaultTracker();

            u.Name  = "Bob";
            u.Level = 1;
            u.Gold  = 10;

            var buf = PrintBytes(Serialize(u.Tracker));

            Log.WriteLine(Deserialize <TrackablePocoTracker <IUserData> >(buf).ToString());
            u.Tracker.Clear();

            u.Level += 10;
            u.Gold  += 100;

            var buf2 = PrintBytes(Serialize(u.Tracker));

            Log.WriteLine(Deserialize <TrackablePocoTracker <IUserData> >(buf2).ToString());
            u.Tracker.Clear();

            Log.WriteLine();
        }
예제 #2
0
        private static void RunTrackablePoco()
        {
            Log.WriteLine("***** TrackablePoco (Json) *****");

            var u = new TrackableUserData();

            u.SetDefaultTracker();

            u.Name  = "Bob";
            u.Level = 1;
            u.Gold  = 10;

            var json = JsonConvert.SerializeObject(u.Tracker, JsonSerializerSettings);

            Log.WriteLine(json);
            u.Tracker.Clear();

            u.Level += 10;
            u.Gold  += 100;

            var json2 = JsonConvert.SerializeObject(u.Tracker, JsonSerializerSettings);

            Log.WriteLine(json2);
            u.Tracker.Clear();

            Log.WriteLine();
        }
 public TrackableUserData Clone()
 {
     var o = new TrackableUserData();
     o._Name = _Name;
     o._Gold = _Gold;
     o._Level = _Level;
     return o;
 }
예제 #4
0
        public TrackableUserData Clone()
        {
            var o = new TrackableUserData();

            o._Name  = _Name;
            o._Gold  = _Gold;
            o._Level = _Level;
            return(o);
        }
예제 #5
0
        private static void RunTrackablePoco()
        {
            Console.WriteLine("***** TrackablePoco *****");

            var u = new TrackableUserData();
            u.SetDefaultTracker();

            u.Name = "Bob";
            u.Level = 1;
            u.Gold = 10;

            Console.WriteLine(u.Tracker);
            u.Tracker.Clear();

            u.Level += 10;
            u.Gold += 100;

            Console.WriteLine(u.Tracker);
            u.Tracker.Clear();

            Console.WriteLine();
        }
예제 #6
0
        private static void RunTrackablePoco()
        {
            Console.WriteLine("***** TrackablePoco *****");

            var u = new TrackableUserData();

            u.SetDefaultTracker();

            u.Name  = "Bob";
            u.Level = 1;
            u.Gold  = 10;

            Console.WriteLine(u.Tracker);
            u.Tracker.Clear();

            u.Level += 10;
            u.Gold  += 100;

            Console.WriteLine(u.Tracker);
            u.Tracker.Clear();

            Console.WriteLine();
        }
예제 #7
0
        private static void RunTrackablePoco()
        {
            Console.WriteLine("***** TrackablePoco (Json) *****");

            var u = new TrackableUserData();
            u.SetDefaultTracker();

            u.Name = "Bob";
            u.Level = 1;
            u.Gold = 10;

            var json = JsonConvert.SerializeObject(u.Tracker, JsonSerializerSettings);
            Console.WriteLine(json);
            u.Tracker.Clear();

            u.Level += 10;
            u.Gold += 100;

            var json2 = JsonConvert.SerializeObject(u.Tracker, JsonSerializerSettings);
            Console.WriteLine(json2);
            u.Tracker.Clear();

            Console.WriteLine();
        }