Esempio n. 1
0
        public Boolean MakeDataUnique()
        {
            var isDataUnique = false;

            isCAbilityDataUnique.TryGetValue(this.AsIntPtr(), out isDataUnique);
            if (isDataUnique)
            {
                return(false);
            }
            // Clone and use new data from the cache.
            this.Data = AbilDataCacheNode.FromId(this.AbilityId)->Clone();
            isCAbilityDataUnique[this.AsIntPtr()] = true;
            return(true);
        }
Esempio n. 2
0
        public Boolean MakeDataShared()
        {
            var isUnique = false;

            isCAbilityDataUnique.TryGetValue(this.AsIntPtr(), out isUnique);
            if (!isUnique)
            {
                return(false);
            }
            // Free the old unique data, to avoid leaking.
            Storm.MemoryFree(new IntPtr(this.Data));
            // Use old data from the cache.
            this.Data = AbilDataCacheNode.FromId(this.AbilityId);
            isCAbilityDataUnique[this.AsIntPtr()] = false;
            return(true);
        }