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); }
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; }
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); }
public override Used FindUsed() { Used used = Used.Assert; used |= Expression.FindUsed(); return(used); }
void AnnounceUsage(MonoBehaviour usedOn) { UsageArgs <CSSItem> usageArgs = new UsageArgs <CSSItem>(this, usedOn); Used.Invoke(usageArgs); //Debug.Log("Used " + this.name); }
public override Used FindUsed() { Used used = Used.Repetition; used |= Expression.FindUsed(); return(used); }
public void Using() { Durability = (Durability + DurabiliryPerHit <= 100 ? DurabiliryPerHit + Durability : 100); Used?.Invoke(this, new UsedEventArgs() { Used = Durability }); }
/// <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(); }
public void Heal(float amount) { if (amount < 0) { throw new ArgumentOutOfRangeException(nameof(amount)); } _health.Value += amount; Used?.Invoke(); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + Used.GetHashCode(); hash = hash * 23 + Card.GetHashCode(); return(hash); } }
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"; }
public RAMAnalysis Analyze() { return(new RAMAnalysis() { Available = Available.IsSensorThresholded(), Total = Total.IsSensorThresholded(), Used = Used.IsSensorThresholded(), UsedPercentage = UsedPercentage.IsSensorThresholded(), }); }
private void DestroyingHandler(GameObject obj) { if (TargetingArrow != null) { Object.Destroy(TargetingArrow.gameObject); TargetingArrow = null; } Used?.Invoke(); }
public virtual void Using() { int oldDurability = Durability; Durability = Durability + DurabiliryPerHit < 100 ? DurabiliryPerHit + Durability : 100; Used?.Invoke(this, new UsedEventArgs() { Used = Durability - oldDurability }); }
public IEnumerable <int> IntoIter() { for (var i = Lower; i < Upper; i++) { if (Used.Contains(i)) { continue; } yield return(i); } }
private static void dfs(Node node) { Used.Add(node); foreach (LinkNode outLink in node.OutLinks) { if (!Used.Contains(outLink.NodeEnd)) { dfs(outLink.NodeEnd); } } }
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); } }
public override Used FindUsed() { Used used = Used.Sequence; foreach (Expression e in Expressions) { used |= e.FindUsed(); } return(used); }
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(); }
public void Setup(IMiniMapView view) { View = view; // 未使用になったら強制非表示 Used.Where(isOn => !isOn) .Subscribe(isOn => { View.SetActive(isOn); }); }
private void UsePart(Link l) { _available.Remove(l); if (Used.Any()) { l.UseSide(Used.Last().FirstFreeSide().Value); } else { l.UseSide(0); } Used.Add(l); }
/** * 获取对象实例 **/ 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); }
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"; }
/// <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); }
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); } }
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); } }
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); }
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()); }
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); }
/// <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; }
/// <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; }