コード例 #1
0
    public static string GetStringForPlace(TypeOfPlace place)
    {
        switch (place)
        {
        case TypeOfPlace.none:
            return("");

        case TypeOfPlace.east:
            return("E");

        case TypeOfPlace.west:
            return("W");

        case TypeOfPlace.south:
            return("S");

        case TypeOfPlace.north:
            return("N");

        case TypeOfPlace.foreign:
            return("F");

        default:
            return("");
        }
    }
コード例 #2
0
    /*
     * public void ApplyTextToModel()
     * {
     *  average = float.Parse(avgText.text);
     *  homerun = float.Parse(homerunText.text);
     *  discipline = float.Parse(disciplineText.text);
     *
     *  onPlayerAbilityValueChange?.Invoke(average, homerun, discipline);
     * }
     */



    public void LoadModel(PlayerModel model)
    {
        average    = model.GetAverage();
        homerun    = model.GetHomerun();
        discipline = model.GetDisc();
        num        = model.num;
        school     = model.school;
        place      = model.place;
        ID         = model.ID;
        grade      = model.grade;
        name       = model.name;

        level = 1;

        modifiedAverage    = average;
        modifiedHomerun    = homerun;
        modifiedDiscipline = discipline;

        display.UpdateText(average, homerun, discipline, grade, name);
        display.UpdateAttribute(school, num, place);
        display.UpdateLevel(level);

        onPlayerAbilityValueChange?.Invoke(average, homerun, discipline);
        onPlayerModelLoaded?.Invoke();
    }
コード例 #3
0
 public void UpdateAttribute(TypeOfSchool school, int num, TypeOfPlace place, int cost)
 {
     colorImage.color = GetColor(school);
     numText.text     = PlayerModel.GetStringForNum(num);
     placeText.text   = PlayerModel.GetStringForPlace(place);
     costText.text    = cost.ToString();
 }
コード例 #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            TypeOfPlace typeOfPlace = db.TypeOfPlace.Find(id);

            db.TypeOfPlace.Remove(typeOfPlace);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #5
0
ファイル: WaypointData.cs プロジェクト: coserra/mongoCaceres
 public WaypointData(string coordinates, TypeOfPlace type, string name, string direction, string uri, string email, string telephone)
 {
     this.Coordinates = coordinates;
     this.Type        = type;
     this.Name        = name;
     this.Address     = direction;
     this.Uri         = uri;
     this.Email       = email;
     this.Telephone   = telephone;
 }
コード例 #6
0
 public ActionResult Edit([Bind(Include = "IdTypeOfPlace,NameTypeOfPlace")] TypeOfPlace typeOfPlace)
 {
     if (ModelState.IsValid)
     {
         db.Entry(typeOfPlace).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(typeOfPlace));
 }
コード例 #7
0
        public ActionResult Create([Bind(Include = "IdTypeOfPlace,NameTypeOfPlace")] TypeOfPlace typeOfPlace)
        {
            if (ModelState.IsValid)
            {
                db.TypeOfPlace.Add(typeOfPlace);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(typeOfPlace));
        }
コード例 #8
0
    void LoadModel(PlayerModel model)
    {
        average    = model.GetAverage();
        homerun    = model.GetHomerun();
        discipline = model.GetDisc();
        num        = model.num;
        school     = model.school;
        place      = model.place;
        cost       = model.grade;

        ID = model.ID;
    }
コード例 #9
0
        // GET: TypeOfPlaces/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TypeOfPlace typeOfPlace = db.TypeOfPlace.Find(id);

            if (typeOfPlace == null)
            {
                return(HttpNotFound());
            }
            return(View(typeOfPlace));
        }
コード例 #10
0
        public string PlaceInfo()
        {
            var parentpath = string.Empty;

            Place currentPlace = this;

            // Generating path from parent and grand(n) parent info
            while (currentPlace.parent != null)
            {
                parentpath   = currentPlace.parent.Alias + (string.IsNullOrEmpty(parentpath) ? string.Empty : $"/{parentpath}");
                currentPlace = currentPlace.parent;
            }

            return($"{Alias}, {parentpath}, {TypeOfPlace.ToString()}");
        }
コード例 #11
0
    private void UpdatePlaceAura(TypeOfPlace place, int[] indexes)
    {
        for (int i = 0; i < indexes.Length; i++)
        {
            RectTransform rect = order[indexes[i]].placeRect;
            Sequence      seq  = DOTween.Sequence().Append(rect.DOScale(
                                                               new Vector2(1.2f, 1.2f),         //終了時点のScale
                                                               0.5f                             //時間
                                                               )).Append(rect.DOScale(
                                                                             new Vector2(1, 1), //終了時点のScale
                                                                             0.5f               //時間
                                                                             ));
            switch (place)
            {
            case TypeOfPlace.east:
                order[indexes[i]].SetAuraForPlace(Color.black);
                seq.Play();
                break;

            case TypeOfPlace.west:
                order[indexes[i]].SetAuraForPlace(Color.black);
                seq.Play();
                break;

            case TypeOfPlace.south:
                order[indexes[i]].SetAuraForPlace(Color.black);
                seq.Play();
                break;

            case TypeOfPlace.north:
                order[indexes[i]].SetAuraForPlace(Color.black);
                seq.Play();
                break;
defalut:
                break;
            }
        }
    }
コード例 #12
0
    private void SetActivePlaceBuff(TypeOfPlace place, bool isActive)
    {
        switch (place)
        {
        case TypeOfPlace.east:
            isEastBuffOn.SetValue(isActive);
            break;

        case TypeOfPlace.west:
            isWestBuffOn.SetValue(isActive);
            break;

        case TypeOfPlace.south:
            isSouthBuffOn.SetValue(isActive);
            break;

        case TypeOfPlace.north:
            isNorthBuffOn.SetValue(isActive);
            break;

        default:
            break;
        }
    }
コード例 #13
0
 public AudioSourceAndPlace(AudioSource source, TypeOfPlace place)
 {
     this.source = source;
     this.place  = place;
 }
コード例 #14
0
 public SoundAndPlace(AudioClip sound, TypeOfPlace place)
 {
     this.sound = sound;
     this.place = place;
 }
コード例 #15
0
 public Place(int num, string type)
 {
     Number = num;
     TypeOf = (TypeOfPlace)Enum.Parse(TypeOf.GetType(), type);
 }
コード例 #16
0
ファイル: JsonReader.cs プロジェクト: coserra/mongoCaceres
    public WaypointData JsonToWaypoint(string t, TypeOfPlace a, bool todo)
    {
        string[] splitArray  = new string[10000];
        string[] splitArray2 = new string[10000];

        string coordenadas, url, telefono, nombre, email, direccion;

        TypeOfPlace tipo;

        //Coordenadas
        splitArray = t.Split(new string[] { "[" }, StringSplitOptions.None);
        if (!splitArray[0].Equals(t))
        {
            splitArray2 = splitArray[1].Split(new string[] { "]" }, StringSplitOptions.None);
            splitArray  = splitArray2[0].Split(new string[] { "," }, StringSplitOptions.None);
            coordenadas = splitArray[1] + ", " + splitArray[0];
        }
        else
        {
            coordenadas = "";
        }

        //URL del lugar
        splitArray = t.Split(new string[] { "\"schema_url\" : \"" }, StringSplitOptions.None);
        if (!splitArray[0].Equals(t))
        {
            splitArray2 = splitArray[1].Split(new string[] { "\"" }, StringSplitOptions.None);
            url         = splitArray2[0];
        }
        else
        {
            url = "";
        }

        //email del lugar
        splitArray = t.Split(new string[] { "\"schema_email\" : \"" }, StringSplitOptions.None);
        if (!splitArray[0].Equals(t))
        {
            splitArray2 = splitArray[1].Split(new string[] { "\"" }, StringSplitOptions.None);
            email       = splitArray2[0];
        }
        else
        {
            email = "";
        }

        //teléfono del lugar
        splitArray = t.Split(new string[] { "\"schema_telephone\" : \"" }, StringSplitOptions.None);
        if (!splitArray[0].Equals(t))
        {
            splitArray2 = splitArray[1].Split(new string[] { "\"" }, StringSplitOptions.None);
            telefono    = splitArray2[0];
        }
        else
        {
            telefono = "";
        }

        //email del lugar
        splitArray = t.Split(new string[] { "\"rdfs_label\" : \"" }, StringSplitOptions.None);
        if (!splitArray[0].Equals(t))
        {
            splitArray2 = splitArray[1].Split(new string[] { "\"" }, StringSplitOptions.None);
            nombre      = splitArray2[0];
        }
        else
        {
            nombre = "";
        }

        //email del lugar
        splitArray = t.Split(new string[] { "\"schema_address_streetAddress\" : \"" }, StringSplitOptions.None);
        if (!splitArray[0].Equals(t))
        {
            splitArray2 = splitArray[1].Split(new string[] { "\"" }, StringSplitOptions.None);
            direccion   = splitArray2[0];
        }
        else
        {
            direccion = "";
        }

        if (todo)
        {
            //tipo
            splitArray = t.Split(new string[] { "\"type\" : \"" }, StringSplitOptions.None);

            splitArray2 = splitArray[1].Split(new string[] { "\"" }, StringSplitOptions.None);
            switch (splitArray2[0])
            {
            case "0":
                tipo = TypeOfPlace.alojamiento;
                break;

            case "1":
                tipo = TypeOfPlace.barCopas;
                break;

            case "2":
                tipo = TypeOfPlace.cafebar;
                break;

            case "3":
                tipo = TypeOfPlace.centroTuristico;
                break;

            case "4":
                tipo = TypeOfPlace.monumento;
                break;

            case "5":
                tipo = TypeOfPlace.restaurante;
                break;

            default:
                tipo = TypeOfPlace.cafebar;
                //Debug.Log("FALLO: " + t);
                break;
            }
        }
        else
        {
            tipo = a;
        }
        WaypointData final = new WaypointData(coordenadas, tipo, nombre, direccion, url, email, telefono);

        return(final);
    }
コード例 #17
0
 public Place(string[] place)
 {
     TypeOf = (TypeOfPlace)Enum.Parse(TypeOf.GetType(), place[0]);
     Number = Convert.ToInt32(place[1]);
 }