Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Module != 0)
            {
                hash ^= Module.GetHashCode();
            }
            if (LevelBottom != 0)
            {
                hash ^= LevelBottom.GetHashCode();
            }
            if (PlotBottom != 0)
            {
                hash ^= PlotBottom.GetHashCode();
            }
            if (Used != 0)
            {
                hash ^= Used.GetHashCode();
            }
            if (FunctionId != 0)
            {
                hash ^= FunctionId.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 2
0
    public void Update()
    {
        // Unity によって割り当てられたメモリ
        Used = (Profiler.GetTotalAllocatedMemoryLong() >> 10) / 1024f;

        // 予約済みだが割り当てられていないメモリ
        Unused = (Profiler.GetTotalUnusedReservedMemoryLong() >> 10) / 1024f;

        // Unity が現在および将来の割り当てのために確保している総メモリ
        Total = (Profiler.GetTotalReservedMemoryLong() >> 10) / 1024f;

        UsedText   = Used.ToString("0.0") + " MB";
        UnusedText = Unused.ToString("0.0") + " MB";
        TotalText  = Total.ToString("0.0") + " MB";

        var sb = new StringBuilder();

        sb.AppendLine("<b>Unity</b>");
        sb.AppendLine();
        sb.AppendLine($"    Used: {UsedText}");
        sb.AppendLine($"    Unused: {UnusedText}");
        sb.AppendLine($"    Total: {TotalText}");

        var text = sb.ToString();

        m_text.text = text;
    }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Type != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (Init != 0L)
            {
                hash ^= Init.GetHashCode();
            }
            if (Max != 0L)
            {
                hash ^= Max.GetHashCode();
            }
            if (Used != 0L)
            {
                hash ^= Used.GetHashCode();
            }
            if (Commited != 0L)
            {
                hash ^= Commited.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 4
0
    public override Used FindUsed()
    {
        Used used = Used.Assert;

        used |= Expression.FindUsed();

        return(used);
    }
Ejemplo n.º 5
0
    void AnnounceUsage(MonoBehaviour usedOn)
    {
        UsageArgs <CSSItem> usageArgs = new UsageArgs <CSSItem>(this, usedOn);

        Used.Invoke(usageArgs);

        //Debug.Log("Used " + this.name);
    }
Ejemplo n.º 6
0
    public override Used FindUsed()
    {
        Used used = Used.Repetition;

        used |= Expression.FindUsed();

        return(used);
    }
Ejemplo n.º 7
0
 public void Using()
 {
     Durability = (Durability + DurabiliryPerHit <= 100 ? DurabiliryPerHit + Durability : 100);
     Used?.Invoke(this, new UsedEventArgs()
     {
         Used = Durability
     });
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Client:
        ///     Handles any additional usage stuff. When this is called, it is to be assumed that the Server has recognized
        ///     the IUsableEntity as having been successfully used.
        /// Server:
        ///     Attempts to use this IUsableEntity on the <paramref name="charEntity"/>.
        /// </summary>
        /// <param name="charEntity">CharacterEntity that is trying to use this IUsableEntity. Can be null.</param>
        /// <returns>True if this IUsableEntity was successfully used, else false. On the Client, this is generally
        /// unused.</returns>
        public override bool Use(DynamicEntity charEntity)
        {
            if (Used != null)
            {
                Used.Raise(this, EventArgsHelper.Create(charEntity));
            }

            return(true);
        }
        private void Button1_Click(object sender, EventArgs e)
        {
            SingleCast_Delegate sObj = new SingleCast_Delegate();
            Use  obj  = new Use(sObj.Display);
            Used obj1 = new Used(SingleCast_Delegate.show);

            MessageBox.Show(obj("Jay Jagadeshwar"));
            obj1.Invoke();
        }
Ejemplo n.º 10
0
 public void Heal(float amount)
 {
     if (amount < 0)
     {
         throw new ArgumentOutOfRangeException(nameof(amount));
     }
     _health.Value += amount;
     Used?.Invoke();
 }
Ejemplo n.º 11
0
        public override int GetHashCode()
        {
            unchecked {
                int hash = 17;
                hash = hash * 23 + Used.GetHashCode();
                hash = hash * 23 + Card.GetHashCode();

                return(hash);
            }
        }
Ejemplo n.º 12
0
        public void Update()
        {
            Used = (Profiler.GetMonoUsedSizeLong() >> 10) / 1024f;

            // ヒープが大きいほど GC の時間がかかりますが、実行される頻度は少なくなる
            Total = (Profiler.GetMonoHeapSizeLong() >> 10) / 1024f;

            UsedText  = Used.ToString("0.0") + " MB";
            TotalText = Total.ToString("0.0") + " MB";
        }
Ejemplo n.º 13
0
 public RAMAnalysis Analyze()
 {
     return(new RAMAnalysis()
     {
         Available = Available.IsSensorThresholded(),
         Total = Total.IsSensorThresholded(),
         Used = Used.IsSensorThresholded(),
         UsedPercentage = UsedPercentage.IsSensorThresholded(),
     });
 }
Ejemplo n.º 14
0
        private void DestroyingHandler(GameObject obj)
        {
            if (TargetingArrow != null)
            {
                Object.Destroy(TargetingArrow.gameObject);
                TargetingArrow = null;
            }

            Used?.Invoke();
        }
Ejemplo n.º 15
0
        public virtual void Using()
        {
            int oldDurability = Durability;

            Durability = Durability + DurabiliryPerHit < 100 ? DurabiliryPerHit + Durability : 100;
            Used?.Invoke(this, new UsedEventArgs()
            {
                Used = Durability - oldDurability
            });
        }
Ejemplo n.º 16
0
 public IEnumerable <int> IntoIter()
 {
     for (var i = Lower; i < Upper; i++)
     {
         if (Used.Contains(i))
         {
             continue;
         }
         yield return(i);
     }
 }
Ejemplo n.º 17
0
 private static void dfs(Node node)
 {
     Used.Add(node);
     foreach (LinkNode outLink in node.OutLinks)
     {
         if (!Used.Contains(outLink.NodeEnd))
         {
             dfs(outLink.NodeEnd);
         }
     }
 }
Ejemplo n.º 18
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Drive != null ? Drive.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Free.GetHashCode();
         hashCode = (hashCode * 397) ^ Used.GetHashCode();
         hashCode = (hashCode * 397) ^ Total.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 19
0
    public override Used FindUsed()
    {
        Used used = Used.Sequence;

        foreach (Expression e in Expressions)
        {
            used |= e.FindUsed();
        }

        return(used);
    }
Ejemplo n.º 20
0
    public virtual void OnDisable()
    {
        // ScriptableObjects' OnDisable() methods are called when scripts are done
        // recompiling (which happens when you save code, go back to the editor, and wait).
        // Then, an OnEnable call is made.

        // This makes OnDisable a good cleanup method for Scriptable Objects. And you can use
        // OnEnable as a sort of initialization method.
        // Debug.Log(this.name + " removing all listeners!");
        Used.RemoveAllListeners();
    }
Ejemplo n.º 21
0
        public void Setup(IMiniMapView view)
        {
            View = view;

            // 未使用になったら強制非表示
            Used.Where(isOn => !isOn)
            .Subscribe(isOn =>
            {
                View.SetActive(isOn);
            });
        }
Ejemplo n.º 22
0
 private void UsePart(Link l)
 {
     _available.Remove(l);
     if (Used.Any())
     {
         l.UseSide(Used.Last().FirstFreeSide().Value);
     }
     else
     {
         l.UseSide(0);
     }
     Used.Add(l);
 }
Ejemplo n.º 23
0
        /**
         * 获取对象实例
         **/
        public T GetObjectInstance <T>() where T : IPoolable, new()
        {
            T    Instance  = default(T);
            Type Prototype = typeof(T);

            if (!ObjectDict.ContainsKey(Prototype))
            {
                CreateObjectPool <T>(CAPACITY);
            }

            List <Object>  Used;
            Queue <Object> Objects;
            bool           Result = ObjectDict.TryGetValue(Prototype, out Objects);

            if (Result)
            {
                ObjectUsedRef.TryGetValue(Prototype, out Used);
                int UsedCount = 0;
                //int Capacity = 0;
                ObjectUsedDict.TryGetValue(Prototype, out UsedCount);
                //CapacityDict.TryGetValue(Prototype, out Capacity);

                if (Objects.Count > 0)
                {
                    //返回第一个
                    Instance = (T)Objects.Dequeue();
                    //更新使用计数
                    UsedCount++;
                    ObjectUsedDict[Prototype] = UsedCount;
                    //添加到使用中的队列
                    Used.Add(Instance);
                }
                else
                {
                    //if (UsedCount < Capacity)
                    //{
                    //创建新的实例
                    Instance = new T();
                    //更新使用计数
                    UsedCount++;
                    ObjectUsedDict[Prototype] = UsedCount;

                    //添加到使用中的队列
                    Used.Add(Instance);
                    //}
                }
            }
            return(Instance);
        }
Ejemplo n.º 24
0
        public void Update()
        {
            // Unity によって割り当てられたメモリ
            Used = (Profiler.GetTotalAllocatedMemoryLong() >> 10) / 1024f;

            // 予約済みだが割り当てられていないメモリ
            Unused = (Profiler.GetTotalUnusedReservedMemoryLong() >> 10) / 1024f;

            // Unity が現在および将来の割り当てのために確保している総メモリ
            Total = (Profiler.GetTotalReservedMemoryLong() >> 10) / 1024f;

            UsedText   = Used.ToString("0.0") + " MB";
            UnusedText = Unused.ToString("0.0") + " MB";
            TotalText  = Total.ToString("0.0") + " MB";
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Client:
        ///     Handles any additional usage stuff. When this is called, it is to be assumed that the Server has recognized
        ///     the IUsableEntity as having been successfully used.
        /// Server:
        ///     Attempts to use this IUsableEntity on the <paramref name="charEntity"/>.
        /// </summary>
        /// <param name="charEntity">CharacterEntity that is trying to use this IUsableEntity. Can be null.</param>
        /// <returns>True if this IUsableEntity was successfully used, else false. On the Client, this is generally
        /// unused.</returns>
        public override bool Use(DynamicEntity charEntity)
        {
            // Check if we can use
            if (!CanUse(charEntity))
            {
                return(false);
            }

            if (!Open)
            {
                Open = true; // For testing after we've tried it once, we'll open it!
                return(false);
            }

            // Teleport to a new map
            if (DestinationMap > 0)
            {
                var c = (Character)charEntity;
                if (c.Map.ID != DestinationMap)
                {
                    var newMap = c.World.GetMap(DestinationMap);
                    if (newMap == null)
                    {
                        const string errmsg = "Failed to teleport Character `{0}` - Invalid DestMap `{1}`.";
                        Debug.Fail(string.Format(errmsg, c, this));
                        if (log.IsErrorEnabled)
                        {
                            log.ErrorFormat(errmsg, c, this);
                        }
                        return(false);
                    }

                    c.Teleport(newMap, Destination);
                }
            }

            // Teleport the CharacterEntity to our predefined location
            charEntity.Position = Destination;

            // Notify listeners
            if (Used != null)
            {
                Used.Raise(this, EventArgsHelper.Create(charEntity));
            }

            // Successfully used
            return(true);
        }
Ejemplo n.º 26
0
        public override int GetHashCode()
        {
            unchecked {
                int hash = 17;
                if (Used != default(bool))
                {
                    hash = hash * 23 + Used.GetHashCode();
                }
                if (Card != default(Card))
                {
                    hash = hash * 23 + Card.GetHashCode();
                }

                return(hash);
            }
        }
Ejemplo n.º 27
0
        public override int GetHashCode()
        {
            unchecked {
                int hash = 17;
                hash = hash * 23 + Amount.GetHashCode();
                hash = hash * 23 + Currency.GetHashCode();
                hash = hash * 23 + Used.GetHashCode();
                hash = hash * 23 + Multiple.GetHashCode();
                hash = hash * 23 + Title.GetHashCode();
                hash = hash * 23 + Description.GetHashCode();
                hash = hash * 23 + Charges.GetHashCode();
                hash = hash * 23 + PaymentURI.GetHashCode();

                return(hash);
            }
        }
Ejemplo n.º 28
0
    private void DoSetUsed()
    {
        Used used = 0;

        foreach (Rule rule in m_grammar.Rules)
        {
            used |= rule.Expression.FindUsed();
        }

        m_engine.AddVariable("used-assert", (used & Used.Assert) == Used.Assert);
        m_engine.AddVariable("used-choice", true);                              // DoParse uses this
        m_engine.AddVariable("used-nassert", (used & Used.NAssert) == Used.NAssert);
        m_engine.AddVariable("used-literal", (used & Used.Literal) == Used.Literal);
        m_engine.AddVariable("used-range", (used & Used.Range) == Used.Range);
        m_engine.AddVariable("used-repetition", (used & Used.Repetition) == Used.Repetition);
        m_engine.AddVariable("used-sequence", (used & Used.Sequence) == Used.Sequence);
    }
Ejemplo n.º 29
0
            public override string ToString()
            {
                var sb = new StringBuilder();

                for (int y = 0; y < Used.GetLength(1); y++)
                {
                    for (int x = 0; x < Used.GetLength(0); x++)
                    {
                        sb.Append(string.Format("{1}{0}{1}", (EmptyPos.X == x && EmptyPos.Y == y) ? "_"
                            : ((DataPos.X == x && DataPos.Y == y) ? "G"
                                : ((Used[x, y] > 20) ? "#"
                                    : ".")),
                                                x == 0 && y == 0 ? "|" : " "));
                    }
                    sb.AppendLine();
                }
                return(sb.ToString());
            }
Ejemplo n.º 30
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (FolderId.Length != 0)
            {
                hash ^= FolderId.GetHashCode();
            }
            if (createdAt_ != null)
            {
                hash ^= CreatedAt.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            hash ^= Labels.GetHashCode();
            if (addressCase_ == AddressOneofCase.ExternalIpv4Address)
            {
                hash ^= ExternalIpv4Address.GetHashCode();
            }
            if (Reserved != false)
            {
                hash ^= Reserved.GetHashCode();
            }
            if (Used != false)
            {
                hash ^= Used.GetHashCode();
            }
            hash ^= (int)addressCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 31
0
 /// <summary>
 /// IMPLEMENTATION: this method uses the related object through a local variable
 /// </summary>
 /// <returns>the result of sending a message to the used object</returns>
 public string SomeMethod(string value)
 {
     Used used = new Used(value);
     // send a message to used object
     return used.SomeProperty;
 }
Ejemplo n.º 32
0
 /// <summary>
 /// IMPLEMENTATION: this method uses the related object through a method parameter
 /// </summary>
 /// <param name="used">the related object to be used</param>
 /// <returns>the result of sending a message to the used object</returns>
 public string Use(Used used)
 {
     // send a message to used object
     return used.SomeProperty;
 }