示例#1
0
        public void SetUnit(long association, object cacheId, IRoleType roleType, object role)
        {
            if (!this.cachedUnitRoleByAssociationByRoleType.TryGetValue(roleType, out var entryByAssociation))
            {
                entryByAssociation = new Dictionary <long, CachedUnitRole>();
                this.cachedUnitRoleByAssociationByRoleType[roleType] = entryByAssociation;
            }

            entryByAssociation[association] = new CachedUnitRole(cacheId, role);
        }
示例#2
0
        public void SetUnit(ObjectId association, object cacheId, IRoleType roleType, object role)
        {
            Dictionary<ObjectId, CachedUnitRole> entryByAssociation;
            if (!this.cachedUnitRoleByAssociationByRoleType.TryGetValue(roleType, out entryByAssociation))
            {
                entryByAssociation = new Dictionary<ObjectId, CachedUnitRole>();
                this.cachedUnitRoleByAssociationByRoleType[roleType] = entryByAssociation;
            }

            entryByAssociation[association] = new CachedUnitRole(cacheId, role);
        }