예제 #1
0
        public MudTrait Add(string name, string val)
        {
            if (Has(name))
            {
                return(null);
            }

            var trait = new MudTrait(name, val);

            _traits.Add(trait);
            //TODO: listeners notify that trait was added
            return(trait);
        }
예제 #2
0
        public MudTrait Set(string name, string val)
        {
            var trait = _traits.SingleOrDefault(x => x.Name == name);

            if (trait != null)
            {
                trait.Value = val;
            }
            else
            {
                trait = new MudTrait(name, val);
            }
            return(trait);
        }