コード例 #1
0
        public AntAIBlackboardProp Remove(string aKey)
        {
            AntAIBlackboardProp result = null;

            if (_dict.ContainsKey(aKey))
            {
                result = _dict[aKey];
                _dict.Remove(aKey);
                if (EventPropertyRemoved != null)
                {
                    EventPropertyRemoved(aKey, result);
                }
            }
            return(result);
        }
コード例 #2
0
        public AntAIBlackboardProp this[string aKey]
        {
            get
            {
                if (_dict.ContainsKey(aKey))
                {
                    return(_dict[aKey]);
                }
                else
                {
                    var prop = new AntAIBlackboardProp();
                    _dict.Add(aKey, prop);
                    if (EventPropertyAdded != null)
                    {
                        EventPropertyAdded(aKey, prop);
                    }

                    return(prop);
                }
            }
            set
            {
                if (_dict.ContainsKey(aKey))
                {
                    _dict[aKey] = value;
                }
                else
                {
                    _dict.Add(aKey, value);
                    if (EventPropertyAdded != null)
                    {
                        EventPropertyAdded(aKey, value);
                    }
                }
            }
        }