public static Friend Create(WorldCharacter pCharacter) { Friend friend = new Friend { ID = pCharacter.Character.ID, Name = pCharacter.Character.Name, Level = pCharacter.Character.CharLevel, Job = pCharacter.Character.Job, Map = GetMapname(pCharacter.Character.PositionInfo.Map), UniqueID = (uint)pCharacter.Character.AccountID, IsOnline = pCharacter.IsIngame, client = pCharacter.Client, }; return friend; }
public static Friend LoadFromDatabase(DataRow row) { Friend friend = new Friend { UniqueID = uint.Parse(row["CharID"].ToString()), ID = int.Parse(row["FriendID"].ToString()), Day = byte.Parse(row["LastConnectDay"].ToString()), Month = byte.Parse(row["LastConnectMonth"].ToString()), }; return friend; }