コード例 #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (TicketEventDateID != null)
         {
             hashCode = hashCode * 59 + TicketEventDateID.GetHashCode();
         }
         if (TicketEventID != null)
         {
             hashCode = hashCode * 59 + TicketEventID.GetHashCode();
         }
         if (VenueID != null)
         {
             hashCode = hashCode * 59 + VenueID.GetHashCode();
         }
         if (EventStartDateTime != null)
         {
             hashCode = hashCode * 59 + EventStartDateTime.GetHashCode();
         }
         if (MaxTickets != null)
         {
             hashCode = hashCode * 59 + MaxTickets.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (VenueID != null)
         {
             hashCode = hashCode * 59 + VenueID.GetHashCode();
         }
         if (VenueName != null)
         {
             hashCode = hashCode * 59 + VenueName.GetHashCode();
         }
         if (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #3
0
        VisualElement CreateVenuePicker(GroupID groupId, Venues venues, VenueID venueIdToSelect = null)
        {
            var venueList = new ScrollView(ScrollViewMode.Vertical)
            {
                style = { marginTop = 8 }
            };

            venueList.Add(new Button(() => CreateNewVenue(groupId))
            {
                text  = "新規会場",
                style = { color = new StyleColor(new Color(0.5f, 1, 0.5f)) }
            });

            foreach (var venue in venues.List.OrderBy(venue => venue.Name))
            {
                var venueButton = new Button(() => { reactiveCurrentVenue.Val = venue; })
                {
                    text  = venue.Name,
                    style = { unityTextAlign = TextAnchor.MiddleLeft },
                };
                venueList.Add(venueButton);
            }

            reactiveCurrentVenue.Val = venues.List.Find(venue => venue.VenueId == venueIdToSelect);

            return(venueList);
        }
コード例 #4
0
        VisualElement CreateVenuePicker(GroupID groupId, Venues venues, VenueID venueIdToSelect = null)
        {
            var venueList = new ScrollView(ScrollViewMode.Vertical)
            {
                style = { marginTop = 8, flexGrow = 1 }
            };

            venueList.Add(new Button(() => CreateNewVenue(groupId))
            {
                text = "新規作成"
            });

            venueList.Add(new Label()
            {
                text = "作成済みワールドから選ぶ", style = { marginTop = 12 }
            });
            foreach (var venue in venues.List.OrderBy(venue => venue.Name))
            {
                var venueButton = new Button(() => { reactiveCurrentVenue.Val = venue; })
                {
                    text  = venue.Name,
                    style = { unityTextAlign = TextAnchor.MiddleLeft },
                };
                venueList.Add(venueButton);
            }

            reactiveCurrentVenue.Val = venues.List.Find(venue => venue.VenueId == venueIdToSelect);

            return(venueList);
        }
コード例 #5
0
ファイル: VenueUploadCLI.cs プロジェクト: AkimiM/stage_360
        static void UploadScene()
        {
            Debug.Log("Upload Start");

            var accessToken = GetEnv("ACCESS_TOKEN");
            var venueId     = new VenueID(GetEnv("VENUE_ID"));

            AssetUploader.Upload(accessToken, venueId);

            Debug.Log("Upload End");
        }
 public PostUploadRequestService(
     string accessToken,
     VenueID venueId,
     Action <UploadRequest> onSuccess = null,
     Action <Exception> onError       = null
     )
 {
     this.accessToken = accessToken;
     this.venueId     = venueId;
     this.onSuccess   = onSuccess;
     this.onError     = onError;
 }
コード例 #7
0
        public static string Upload(string accessToken, VenueID venueId)
        {
            var request = APIServiceClient.PostUploadRequest.CallSync(venueId, accessToken);

            AssetUpload(accessToken, "assetbundle/win", EditorPrefsUtils.LastBuildWin, request.UploadRequestId);
            AssetUpload(accessToken, "assetbundle/mac", EditorPrefsUtils.LastBuildMac, request.UploadRequestId);
            AssetUpload(accessToken, "assetbundle/android", EditorPrefsUtils.LastBuildAndroid, request.UploadRequestId);
            AssetUpload(accessToken, "assetbundle/ios", EditorPrefsUtils.LastBuildIOS, request.UploadRequestId);

            var response = APIServiceClient.PostNotifyFinishedUpload.CallSync((venueId, request.UploadRequestId), accessToken);

            return(response.Url);
        }
コード例 #8
0
        async Task RefreshVenueSelector(GroupID groupIdToSelect = null, VenueID venueIdToSelect = null)
        {
            selector.Clear();
            selector.Add(new IMGUIContainer(() => EditorGUILayout.HelpBox("会場情報を取得しています...", MessageType.None)));

            VisualElement venuePicker = null;

            void RecreateVenuePicker(GroupID groupId)
            {
                if (venuePicker != null)
                {
                    selector.Remove(venuePicker);
                }

                venuePicker = CreateVenuePicker(groupId, allVenues[groupId], venueIdToSelect);
                selector.Add(venuePicker);
            }

            try
            {
                var groups = await APIServiceClient.GetGroups.Call(Empty.Value, userInfo.VerifiedToken, 3);

                foreach (var group in groups.List)
                {
                    allVenues[group.Id] = await APIServiceClient.GetGroupVenues.Call(group.Id, userInfo.VerifiedToken, 3);
                }

                selector.Clear();
                if (groups.List.Count == 0)
                {
                    selector.Add(new IMGUIContainer(() => EditorGUILayout.HelpBox("clusterにてチーム登録をお願いいたします", MessageType.Warning)));
                }
                else
                {
                    var teamMenu = new PopupField <Group>("所属チーム", groups.List, 0, group => group.Name, group => group.Name);
                    teamMenu.RegisterValueChangedCallback(ev => RecreateVenuePicker(ev.newValue.Id));
                    selector.Add(teamMenu);

                    var groupToSelect = groups.List.Find(group => group.Id == groupIdToSelect) ?? groups.List[0];
                    teamMenu.SetValueWithoutNotify(groupToSelect);

                    RecreateVenuePicker(groupToSelect.Id);
                }
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                selector.Clear();
                selector.Add(new IMGUIContainer(() => EditorGUILayout.HelpBox($"会場情報の取得に失敗しました {e.Message}", MessageType.Error)));
            }
        }
コード例 #9
0
 public PostNotifyFinishedUploadService(
     string accessToken,
     VenueID venueId,
     UploadRequestID uploadRequestId,
     bool isPublish,
     Action <VenueUploadRequestCompletionResponse> onSuccess = null,
     Action <Exception> onError = null
     )
 {
     this.accessToken     = accessToken;
     this.venueId         = venueId;
     this.uploadRequestId = uploadRequestId;
     this.isPublish       = isPublish;
     this.onSuccess       = onSuccess;
     this.onError         = onError;
 }
 /// thumbnailImagePath = "" のとき: payload.thumbnailUrlsが使われる
 /// thumbnailImagePath != "" のとき: 新しくアップロードされてpayload.thumbnailUrlsは無視される
 public PatchVenueSettingService(
     string accessToken,
     VenueID venueId,
     PatchVenuePayload payload,
     string thumbnailImagePath     = "",
     Action <Json.Venue> onSuccess = null,
     Action <Exception> onError    = null
     )
 {
     this.accessToken        = accessToken;
     this.venueId            = venueId;
     this.payload            = payload;
     this.thumbnailImagePath = thumbnailImagePath;
     this.onSuccess          = onSuccess;
     this.onError            = onError;
 }
コード例 #11
0
        /// <summary>
        /// Returns true if EventDate instances are equal
        /// </summary>
        /// <param name="other">Instance of EventDate to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EventDate other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TicketEventDateID == other.TicketEventDateID ||
                     TicketEventDateID != null &&
                     TicketEventDateID.Equals(other.TicketEventDateID)
                     ) &&
                 (
                     TicketEventID == other.TicketEventID ||
                     TicketEventID != null &&
                     TicketEventID.Equals(other.TicketEventID)
                 ) &&
                 (
                     VenueID == other.VenueID ||
                     VenueID != null &&
                     VenueID.Equals(other.VenueID)
                 ) &&
                 (
                     EventStartDateTime == other.EventStartDateTime ||
                     EventStartDateTime != null &&
                     EventStartDateTime.Equals(other.EventStartDateTime)
                 ) &&
                 (
                     MaxTickets == other.MaxTickets ||
                     MaxTickets != null &&
                     MaxTickets.Equals(other.MaxTickets)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ));
        }
コード例 #12
0
        /// <summary>
        /// Returns true if Venue instances are equal
        /// </summary>
        /// <param name="other">Instance of Venue to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Venue other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     VenueID == other.VenueID ||
                     VenueID != null &&
                     VenueID.Equals(other.VenueID)
                     ) &&
                 (
                     VenueName == other.VenueName ||
                     VenueName != null &&
                     VenueName.Equals(other.VenueName)
                 ) &&
                 (
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     Country == other.Country ||
                     Country != null &&
                     Country.Equals(other.Country)
                 ));
        }
コード例 #13
0
        VisualElement CreateVenuePicker(GroupID groupId, Venues venues, VenueID venueIdToSelect = null)
        {
            var container = new VisualElement()
            {
                style = { flexDirection = FlexDirection.Row }
            };

            if (venues.List.Count != 0)
            {
                var dupedVenueNames = new HashSet <string>(
                    venues.List.GroupBy(venue => venue.Name, venue => venue.VenueId, (name, ids) => ids.Count() >= 2 ? name : "").Where(name => name != ""));
                string GetUniqueVenueName(Core.Editor.Venue.Json.Venue venue)
                {
                    return(dupedVenueNames.Contains(venue.Name) ? $"{venue.Name} ({venue.VenueId.Value})" : venue.Name);
                }

                var venueMenu = new PopupField <Core.Editor.Venue.Json.Venue>("会場一覧", venues.List, 0, GetUniqueVenueName, GetUniqueVenueName);
                venueMenu.style.flexGrow = 1f;
                venueMenu.RegisterValueChangedCallback(ev => { reactiveCurrentVenue.Val = ev.newValue; });
                container.Add(venueMenu);

                var venueToSelect = venues.List.Find(venue => venue.VenueId == venueIdToSelect) ?? venues.List[0];
                venueMenu.SetValueWithoutNotify(venueToSelect);

                reactiveCurrentVenue.Val = venueToSelect;
            }
            else
            {
                reactiveCurrentVenue.Val = null;
            }

            container.Add(new Button(() => CreateNewVenue(groupId))
            {
                text = "新規会場追加"
            });
            return(container);
        }
コード例 #14
0
        async Task RefreshVenueSelector(GroupID groupIdToSelect = null, VenueID venueIdToSelect = null)
        {
            selector.Clear();
            selector.Add(new Label()
            {
                text = "loading..."
            });

            var venuePickerHolder = new VisualElement()
            {
                style = { flexGrow = 1 }
            };

            void RecreateVenuePicker(GroupID groupId)
            {
                venuePickerHolder.Clear();
                venuePickerHolder.Add(CreateVenuePicker(groupId, allVenues[groupId], venueIdToSelect));
            }

            try
            {
                // Fetch all data
                var groups = await APIServiceClient.GetGroups.Call(Empty.Value, userInfo.VerifiedToken, 3);

                foreach (var group in groups.List)
                {
                    allVenues[group.Id] = await APIServiceClient.GetGroupVenues.Call(group.Id, userInfo.VerifiedToken, 3);
                }

                // Construct menu
                selector.Clear();
                selector.Add(new Label("所属チーム"));
                if (groups.List.Count == 0)
                {
                    selector.Add(new Label()
                    {
                        text = "読み込みに失敗しました"
                    });
                }
                else
                {
                    var teamMenu = new PopupField <Group>(groups.List, 0, group => group.Name, group => group.Name);
                    teamMenu.RegisterValueChangedCallback(ev => RecreateVenuePicker(ev.newValue.Id));
                    selector.Add(teamMenu);

                    var groupToSelect = groups.List.Find(group => group.Id == groupIdToSelect) ?? groups.List[0];
                    teamMenu.SetValueWithoutNotify(groupToSelect);

                    RecreateVenuePicker(groupToSelect.Id);
                }

                selector.Add(UiUtils.Separator());

                selector.Add(new Label()
                {
                    text = "ワールド"
                });
                selector.Add(venuePickerHolder);

                selector.Add(UiUtils.Separator());

                selector.Add(new Label("ユーザーID"));
                var userSelector = new VisualElement()
                {
                    style = { flexShrink = 0 }
                };
                userSelector.Add(new Label(userInfo.Username));
                userSelector.Add(new Button(() => reactiveForceLogout.Val = true)
                {
                    text = "アカウント切替"
                });
                selector.Add(userSelector);
            }
            catch (Exception e)
            {
                Debug.LogException(e);
                selector.Clear();
                selector.Add(new IMGUIContainer(() => EditorGUILayout.HelpBox($"会場情報の取得に失敗しました", MessageType.Error)));
            }
        }
コード例 #15
0
ファイル: FullEventDate.cs プロジェクト: erolss/TicketShop
        /// <summary>
        /// Returns true if EventDate instances are equal
        /// </summary>
        /// <param name="other">Instance of EventDate to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(FullEventDate other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TicketEventDateID == other.TicketEventDateID ||
                     TicketEventDateID != null &&
                     TicketEventDateID.Equals(other.TicketEventDateID)
                     ) &&
                 (
                     TicketEventID == other.TicketEventID ||
                     TicketEventID != null &&
                     TicketEventID.Equals(other.TicketEventID)
                 ) &&
                 (
                     EventName == other.EventName ||
                     EventName != null &&
                     EventName.Equals(other.EventName)
                 ) &&
                 (
                     EventHtmlDescription == other.EventHtmlDescription ||
                     EventHtmlDescription != null &&
                     EventHtmlDescription.Equals(other.EventHtmlDescription)
                 ) &&
                 (
                     EventImagePath == other.EventImagePath ||
                     EventImagePath != null &&
                     EventImagePath.Equals(other.EventImagePath)
                 ) &&
                 (
                     VenueID == other.VenueID ||
                     VenueID != null &&
                     VenueID.Equals(other.VenueID)
                 ) &&
                 (
                     VenueName == other.VenueName ||
                     VenueName != null &&
                     VenueName.Equals(other.VenueName)
                 ) &&
                 (
                     Address == other.Address ||
                     Address != null &&
                     Address.Equals(other.Address)
                 ) &&
                 (
                     City == other.City ||
                     City != null &&
                     City.Equals(other.City)
                 ) &&
                 (
                     Country == other.Country ||
                     Country != null &&
                     Country.Equals(other.Country)
                 ) &&
                 (
                     EventStartDateTime == other.EventStartDateTime ||
                     EventStartDateTime != null &&
                     EventStartDateTime.Equals(other.EventStartDateTime)
                 ) &&
                 (
                     MaxTickets == other.MaxTickets ||
                     MaxTickets != null &&
                     MaxTickets.Equals(other.MaxTickets)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ));
        }
コード例 #16
0
ファイル: FullEventDate.cs プロジェクト: erolss/TicketShop
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (TicketEventDateID != null)
         {
             hashCode = hashCode * 59 + TicketEventDateID.GetHashCode();
         }
         if (TicketEventID != null)
         {
             hashCode = hashCode * 59 + TicketEventID.GetHashCode();
         }
         if (EventName != null)
         {
             hashCode = hashCode * 59 + EventName.GetHashCode();
         }
         if (EventHtmlDescription != null)
         {
             hashCode = hashCode * 59 + EventHtmlDescription.GetHashCode();
         }
         if (EventImagePath != null)
         {
             hashCode = hashCode * 59 + EventImagePath.GetHashCode();
         }
         if (VenueID != null)
         {
             hashCode = hashCode * 59 + VenueID.GetHashCode();
         }
         if (VenueName != null)
         {
             hashCode = hashCode * 59 + VenueName.GetHashCode();
         }
         if (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         if (EventStartDateTime != null)
         {
             hashCode = hashCode * 59 + EventStartDateTime.GetHashCode();
         }
         if (MaxTickets != null)
         {
             hashCode = hashCode * 59 + MaxTickets.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #17
0
ファイル: VenueEdit.cs プロジェクト: alexsp17/SnookerByb
 public override string ToString()
 {
     return("VenueID=" + VenueID.ToString() + " AthleteID=" + AthleteID + " " + Time.ToShortDateString());
 }