public override int GetHashCode() { int hashcode = 157; unchecked { if (__isset.mid) { hashcode = (hashcode * 397) + Mid.GetHashCode(); } if (__isset.memberCount) { hashcode = (hashcode * 397) + MemberCount.GetHashCode(); } if (__isset.onAir) { hashcode = (hashcode * 397) + OnAir.GetHashCode(); } if (__isset.businessAccount) { hashcode = (hashcode * 397) + BusinessAccount.GetHashCode(); } if (__isset.addable) { hashcode = (hashcode * 397) + Addable.GetHashCode(); } if (__isset.acceptableContentTypes) { hashcode = (hashcode * 397) + TCollections.GetHashCode(AcceptableContentTypes); } if (__isset.capableMyhome) { hashcode = (hashcode * 397) + CapableMyhome.GetHashCode(); } } return(hashcode); }
/// <summary> /// Add an item into the <see cref="IPagedDataSet{TItem, TResult}"/> with the position relative to the <see cref="ISelectable{TItem}"/>'s caret /// </summary> /// <param name="addable">The adder to perform</param> /// <param name="item">The item to add</param> /// <param name="offset">The position to add relative to the <see cref="IPagedDataSet{TItem, TResult}"/> caret</param> /// <returns></returns> public static Task AddOffset <TItem, TResult>(this Addable <TItem, TResult> addable, TItem item, int offset) where TItem : class => AddOffset(addable, addable.PagedDataSet, item, offset);
public override string ToString() { var sb = new StringBuilder("BuddyDetail("); bool __first = true; if (Mid != null && __isset.mid) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Mid: "); Mid.ToString(sb); } if (__isset.memberCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("MemberCount: "); MemberCount.ToString(sb); } if (__isset.onAir) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("OnAir: "); OnAir.ToString(sb); } if (__isset.businessAccount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("BusinessAccount: "); BusinessAccount.ToString(sb); } if (__isset.addable) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Addable: "); Addable.ToString(sb); } if (AcceptableContentTypes != null && __isset.acceptableContentTypes) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("AcceptableContentTypes: "); AcceptableContentTypes.ToString(sb); } if (__isset.capableMyhome) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("CapableMyhome: "); CapableMyhome.ToString(sb); } sb.Append(")"); return(sb.ToString()); }
public void Init(Dungeon dungeon) { Addable[] addables = dungeon.Addables; int playerIndex = PLACEHOLDER_PLAYER_INDEX; // find player index for (int i = 0; i < addables.Length && playerIndex == PLACEHOLDER_PLAYER_INDEX; i++) { Addable addable = addables[i]; if (addable.AddableType == AddableType.STATIC && addable.StaticData.TileType == TileType.PLAYER) { playerIndex = i; } } // find floor with player int[] startingFloor = null; Floor[] dungeonFloors = dungeon.Floors; for (int i = 0; i < dungeonFloors.Length && startingFloor == null; i++) { int[] indices = dungeonFloors[i].Indices; for (int j = 0; j < indices.Length && startingFloor == null; j++) { int index = indices[j]; if (index == playerIndex) { startingFloor = indices; } } } // Who submits an empty level??? if (startingFloor != null) { // setup preview, startingFloor length should match preview for (int i = 0; i < startingFloor.Length; i++) { PreviewElement element = elements[i]; int index = startingFloor[i]; element.IsVisible = (index != SerializationUtil.NO_ELEMENT); if (index != SerializationUtil.NO_ELEMENT) { Addable addable = addables[index]; Sprite sprite = null; switch (addable.AddableType) { case AddableType.STATIC: sprite = SpriteList.GetStatic(addable.StaticData.TileType); break; case AddableType.BOOSTER: sprite = SpriteList.GetBooster(addable.BoosterData.SpriteID); break; case AddableType.ENEMY: sprite = SpriteList.GetEnemy(addable.EnemyData.SpriteID); break; } element.Sprite = sprite; } } } }
public override Number Add(Addable X, Addable Y) { return(new Number(X.Value + Y.Value)); }