コード例 #1
0
 public Character()
 {
     CreatedAt         = DateTime.Now;
     LastActivity      = DateTime.Now;
     Locked            = false;
     Hunger            = 100;
     Thirst            = 100;
     Health            = 100;
     Cash              = Constants.StartCash;
     Position          = Constants.DefaultSpawnPosition.ToJson();
     Rotation          = Constants.DefaultSpawnRotation;
     BankAccountAccess = new List <int>();
     Armor             = 0;
     SalaryTime        = 0;
     TotalPlayTime     = 0;
     KeyRing           = new KeyRing();
 }
コード例 #2
0
        public void StringToData()
        {
            if (KeyRingString != "" && KeyRingString != null)
            {
                KeyRing = JsonConvert.DeserializeObject <KeyRing>(KeyRingString);
            }
            else
            {
                KeyRing = new KeyRing();
            }

            if (InventoryString != "" && InventoryString != null)
            {
                Inventory = JsonConvert.DeserializeObject <List <InventoryItem> >(InventoryString);
            }
            else
            {
                Inventory = new List <InventoryItem>();
            }
        }