1. This is my current code to create/get playerdata on player enter
    Code:
     void OnPlayerInit(BasePlayer player)
            {
                PlayerData temp = new PlayerData(player.userID);
                if (storedData.players.Contains(temp) == false)
                {
                 //create a new PlayerData object to save in file
                }
            }
    But my question relates to the Contains method of the storedData.players hashset
    Code:
     class PlayerData
            {
                public ulong id;
                public int bank;
                public int kills;
                public int deaths;
                public Clan clan;
                public List<Quest> quests;
                public Hash<string, byte> bonuses;
                public PlayerData(ulong newid)
                {
                    id = newid;
                    bank = 0;
                    kills = 0;
                    deaths = 0;
                    clan = null;
                    quests = new List<Quest>();
                    bonuses = new Hash<string, byte>
                    {
                        ["mining"] = 0,
                        ["forestry"] = 0,
                        ["engineering"] = 0,
                        ["leadership"] = 0,
                        ["industry"] = 0
                    };
                }
            }
    I'm trying to determine whether a player's data is in file or not based on the id field of the PlayerData. Will this work or will it not recognize the data as the other values are different from default?

    EDIT: So far I've overridden the getHashCode and Equals methods on the objects so they compare based on the UserID field. Don't have a server to test but is this correct?
    [DOUBLEPOST=1454297442,1454213896][/DOUBLEPOST]Alrighty, so worked around it by moving PlayerID out and creating a Dictionary<ulong,PlayerData> to get PlayerData of a specific UserID
     
  2. Assuming storeddata is a List<>
    Code:
    var _selection = storedData.players.where(x => x.id == player.userID).DefaultIfEmpty(null).FirstOrDefault();
    if ( _selection != null )
    {
        //_selection contains the PlayerData container that resides inside StoredData for the player with the UID searched.
    } else {
        //_selection is null, player with uid cant be found.
    }
     
  3. Thanks for the reply! :)