예제 #1
0
        public StatInstance this[StatIdentifier identifier]
        {
            get
            {
                if (Stats == null)
                {
                    return(null);
                }

                return(Stats[identifier]);
            }
        }
예제 #2
0
        public StatTemplate this[StatIdentifier identifier]
        {
            get
            {
                if (Stats == null)
                {
                    return(null);
                }

                return(Stats[identifier]);
            }
        }
예제 #3
0
        public StatInstance this[StatIdentifier identifier]
        {
            get
            {
                if (Stats == null)
                {
                    return(null);
                }

                if (!Stats.TryGetValue(identifier, out var instance))
                {
                    var template = traitContext.Stats[identifier];
                    instance = template.CreateInstance(identifier);
                    Stats.Add(identifier, instance);
                }
                return(instance);
            }
        }