Пример #1
0
    public void createContent(FeelingType feelingType)
    {
        BackButton.gameObject.SetActive(true);
        TCS   = GameObject.FindObjectOfType <TunneCreationScript>();
        feels = TCS.getListOfFeelings().FindAll(feeling => feeling.GetType().Equals(feelingType));
        int   numberOfFeelings = feels.Count;
        float ang    = -360f / (10);
        float offset = 90;

        if (!RCS.isRightSide)
        {
            RCS.switchSide(); switched = true;
        }
        for (int i = 0; i < 10; i++)
        {
            GameObject tempObject;
            Vector3    center = new Vector3(0, -1f, 0);
            Vector3    pos    = GetButtonPosition(center, 0.49f, ang * i + offset);
            Quaternion rot    = transform.rotation;
            tempObject = Instantiate(feelingButtonPrefab, pos, rot) as GameObject;
            tempObject.transform.SetParent(roulette.transform, false);
            tempObject.transform.Rotate(new Vector3(-90, 0, i * ang + offset));
            FeelingButtonControllerScript FBCS = tempObject.GetComponent <FeelingButtonControllerScript>();
            FBCS.feelingInterface = feels[i];
            TextMesh textObject = tempObject.GetComponentInChildren(typeof(TextMesh)) as TextMesh;
            textObject.text = feels[i].GetFeeling();
        }
        if (switched)
        {
            RCS.switchSide();
        }
        switched = false;
    }
        private static string GetFeelingSuffixText(FeelingType feeling)
        {
            switch (feeling)
            {
            case FeelingType.Normal:
                return(NORMAL_FACE_SUFFIX);

            case FeelingType.Happy:
                return(HAPPY_FACE_SUFFIX);

            case FeelingType.Like:
                return(LIKE_FACE_SUFFIX);

            case FeelingType.Surprised:
                return(SURPRISED_FACE_SUFFIX);

            case FeelingType.Frustrated:
                return(FRUSTRATED_FACE_SUFFIX);

            case FeelingType.Puzzled:
                return(PUZZLED_FACE_SUFFIX);
            }

            throw new Exception();
        }
Пример #3
0
        private void buttonSave_Click(object sender, EventArgs e)
        {
            FeelingType feelingtype = (FeelingType)comboBoxFeeling.SelectedItem;

            if (ClientTo != null && feelingtype != null)
            {
                try {
                    using (ProjetSGBDEntities context = new ProjetSGBDEntities()) {
                        context.UpdateFeeling(CurrentClient.Id, ClientTo.ClientId, feelingtype.Id, ClientTo.ModifiedAt, CurrentClient.Acronym);
                    }
                } catch (Exception ex) {
                    ModelError modelError = new ModelError(ex);
                    if (modelError.Number == ModelError.DATA_NOT_UP_TO_DATE)
                    {
                        MessageBox.Show(modelError.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        LoadFeeling(ClientTo.ClientId);
                        DialogResult = DialogResult.None;
                    }
                    else
                    {
                        MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Пример #4
0
    public void SetFeelingValue(FeelingType feelingType, int value)
    {
        var feeling = this.User.CurrentData.Feelings.Where(w => w.FeelingType == feelingType).FirstOrDefault();

        if (feeling != null)
        {
            feeling.Value = value;
            this.SaveUser();
        }
    }
        public static Uri GetNormalFaceIconUri(Uri faceIconUri, FeelingType feeling)
        {
            if (feeling == FeelingType.Normal)
            {
                return(faceIconUri);
            }

            var uriText = faceIconUri.ToString();

            return(new Uri(uriText.Substring(0, uriText.Length - GetFeelingSuffixText(feeling).Length) + NORMAL_FACE_SUFFIX));
        }
Пример #6
0
        public static string ConverterFeelingType(FeelingType ft)
        {
            switch (ft)
            {
            case FeelingType.PhysicalCondition:
                return("Physical Condition");

            case FeelingType.Mood:
                return("Mood");

            default:
                throw new Exception("The FeelingType doesn't exist!");
            }
        }
        private void buttonSave_Click(object sender, EventArgs e)
        {
            DishWishSelection dish        = (DishWishSelection)comboBoxDishes.SelectedItem;
            FeelingType       feelingtype = (FeelingType)comboBoxFeeling.SelectedItem;

            if ((dish != null) && (feelingtype != null))
            {
                try {
                    using (ProjetSGBDEntities context = new ProjetSGBDEntities()) {
                        context.NewWishedDish(CurrentClient.Id, dish.DishId, feelingtype.Id, CurrentClient.Acronym);
                    }
                } catch (Exception ex) {
                    ModelError modelError = new ModelError(ex);
                    MessageBox.Show(modelError.Message, "Erreur fatale!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    DialogResult = DialogResult.None;
                }
            }
        }
Пример #8
0
 private Post(string id, bool accept, string discussionType, DateTime time, PostTag tag, uint replyCount, uint empathyCount, bool isPlayed, bool isSpoiler, Uri screenShotUri, PostUser user, FeelingType feeling, PostCommunity community)
 {
     this.ID = id;
     this.IsAcceptingResponse = accept;
     this.DiscussionType      = discussionType;
     this.PostedDate          = time;
     this.Tag           = tag;
     this.ReplyCount    = replyCount;
     this.EmpathyCount  = empathyCount;
     this.IsPlayed      = isPlayed;
     this.IsSpoiler     = isSpoiler;
     this.ScreenShotUri = screenShotUri;
     this.User          = user;
     this.Feeling       = feeling;
     this.Community     = community;
 }
Пример #9
0
 public Post(string id, bool accept, string discussionType, DateTime time, PostTag tag, Uri imageUri, uint replyCount, uint empathyCount, bool isPlayed, bool isSpoiler, Uri screenShotUri, PostUser user, FeelingType feeling, PostCommunity community)
     : this(id, accept, discussionType, time, tag, replyCount, empathyCount, isPlayed, isSpoiler, screenShotUri, user, feeling, community)
 {
     this.Text     = null;
     this.ImageUri = imageUri;
 }
Пример #10
0
 public Post(string id, bool accept, string discussionType, DateTime time, Uri imageUri, uint replyCount, uint empathyCount, bool isPlayed, bool isSpoiler, PostUser user, FeelingType feeling, PostCommunity community)
     : this(id, accept, discussionType, time, imageUri, replyCount, empathyCount, isPlayed, isSpoiler, null, user, feeling, community)
 {
 }
Пример #11
0
 public Post(string id, bool accept, string discussionType, DateTime time, string text, uint replyCount, uint empathyCount, bool isPlayed, bool isSpoiler, PostUser user, FeelingType feeling, PostCommunity community, string inReplyToId)
     : this(id, accept, discussionType, time, text, replyCount, empathyCount, isPlayed, isSpoiler, null, user, feeling, community)
 {
     this.InReplyToId = inReplyToId;
 }