コード例 #1
0
ファイル: PointsSystem.cs プロジェクト: EquinoxQNX/TrueUO
        public PointsEntry GetEntry(Mobile from, bool create = false)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm == null)
            {
                return(null);
            }

            PointsEntry entry = PlayerTable.FirstOrDefault(e => e.Player == pm);

            if (entry == null && (create || AutoAdd))
            {
                entry = AddEntry(pm);
            }

            return(entry);
        }
コード例 #2
0
        public TEntry GetPlayerEntry <TEntry>(Mobile mobile, bool create = false) where TEntry : PointsEntry
        {
            PlayerMobile pm = mobile as PlayerMobile;

            if (pm == null)
            {
                return(null);
            }

            TEntry e = PlayerTable.FirstOrDefault(p => p.Player == pm) as TEntry;

            if (e == null && (AutoAdd || create))
            {
                e = AddEntry(pm) as TEntry;
            }

            return(e);
        }