예제 #1
0
    /*
     * //Untested function
     * //Unnessessary in new implementation
     * //Old method
     * //Sees if given loc is found in visitedLocations list. Returns bool
     * public Boolean CheckForVisitedLocation(StoryEngine.Location loc)
     * {
     *  bool result = false;
     *
     * for(int i = 0; i < visitedLocations.Count; i++)
     *  {
     *      if(loc == visitedLocations[i])
     *      {
     *          result = true;
     *          break;
     *      }
     *  }
     *  return result;
     * }*/
    #endregion

    public void UpdateLocation(StoryEngine.Location loc)
    {
        if (loc != lastLocation)
        {
            previousLocation = lastLocation;
            lastLocation     = loc;
        }
    }
예제 #2
0
    //Untested function
    //Old Function
    //Sees if given loc is found in given list. Returns bool
    public Boolean CompareToLocationEnum(StoryEngine.Location loc, StoryEngine.Location[] locList)
    {
        bool result = false;

        foreach (StoryEngine.Location locat in Enum.GetValues(typeof(StoryEngine.Location)))
        {
            if (locat == loc)
            {
                result = true;
                break;
            }
        }
        return(result);
    }
예제 #3
0
    //Possibly unnessesary
    //Under Testing...
    //Bugged in var1!=var2
    //Causes multible entriest at the time instead of blocking dublicates
    public void CheckForLocation(StoryEngine.Location loc)
    {
        visitedLocationsBoolean[(int)loc] = true;

        #region old_implementation
        //visitedLocations.Add(loc);

        /*
         * //Old implementation
         * if(visitedLocations.Count >= 0)
         * {
         *  Debug.Log("CheckForLocations debug.");
         *  Debug.Log((int)loc);
         *
         *  if (visitedLocationsBoolean[(int)loc] == false)
         *  {
         *      //visitedLocations.Add(loc);
         *      visitedLocationsBoolean[(int)loc] = true;
         *  }
         * }
         */
        /*
         * //Old
         * if (visitedLocations.Count != 0)
         * {
         *  Debug.Log("CheckForLocations debug.");
         *
         *  //bugged adds too many
         *  for (int i = 0; i <= visitedLocations.Count - 1; i++)
         *  {
         *      string var1 = Enum.GetName(typeof(StoryEngine.Location), visitedLocations[i]);
         *      Debug.Log(var1);
         *      string var2 = Enum.GetName(typeof(StoryEngine.Location), loc);
         *      Debug.Log(var2);
         *      if (var1 != var2)
         *      {
         *          visitedLocations.Add(loc);
         *      }
         *  }
         * }
         * else
         * {
         *  visitedLocations.Add(loc);
         * }
         */
        #endregion
    }
예제 #4
0
 // Use this for initialization
 void Start()
 {
     visitedLocationsBoolean[(int)StoryEngine.Location.NoLocation] = true;
     testing                     = false;
     lastLocation                = StoryEngine.Location.NoLocation;
     previousLocation            = StoryEngine.Location.NoLocation;
     nextLocationAdviceInt       = 1; //sets loc advice for porraskäytävä for first advice
     mapCanvas                   = GameObject.FindGameObjectWithTag("MapCanvas");
     visitedLocationsBoolean[0]  = false;
     visitedLocationsBoolean[1]  = false;
     visitedLocationsBoolean[2]  = false;
     visitedLocationsBoolean[3]  = false;
     visitedLocationsBoolean[4]  = false;
     visitedLocationsBoolean[5]  = false;
     visitedLocationsBoolean[6]  = false;
     visitedLocationsBoolean[7]  = false;
     visitedLocationsBoolean[8]  = false;
     visitedLocationsBoolean[9]  = false;
     visitedLocationsBoolean[10] = false;
     //mapCanvas.GetComponent<MapCanvasScript>().UpdateAdviceIndex(1); //not working now
 }
예제 #5
0
    /// <summary>
    /// Returns text for the needed location
    /// </summary>
    /// <returns></returns>
    public string CreateInfoText(StoryEngine.Location loc)
    {
        if (testing)
        {
            //Sets visited location flag to true
            visitedLocationsBoolean[(int)loc] = true;

            //updates location
            //Last change in evening
            if (lastLocation == StoryEngine.Location.NoLocation)
            {
                previousLocation = StoryEngine.Location.NoLocation;
                lastLocation     = loc;
                CheckForLocation(loc);
                //visitedLocations.Add(loc);
            }
            else
            {
                if (loc != lastLocation)
                {
                    previousLocation = lastLocation;
                    lastLocation     = loc;
                    //visitedLocations.Add(loc);
                    CheckForLocation(loc);
                }
            }


            //Temp text
            string createdText = "";


            int l = (int)lastLocation;
            int p = (int)previousLocation;


            if (testing)
            {
                //check to see if user isn't at the advice location
                if ((int)loc != nextLocationAdviceInt)
                {
                }


                //Pre text
                switch (p)
                {
                case 0:
                {
                    createdText += "Tämä on ensimmäinen paikkanne?";
                    break;
                }

                case 1:
                {
                    createdText += "Aula on poissa mielestä kun matka jatkuu.";
                    break;
                }

                case 2:
                {
                    createdText += "";
                    break;
                }

                case 3:
                {
                    createdText += "";
                    break;
                }

                case 4:
                {
                    createdText += "";
                    break;
                }

                case 5:
                {
                    createdText += "Tekoälyn tutkinnassa ei ollut mitään ihmeellistä… Eihän.";
                    break;
                }

                case 6:
                {
                    createdText += "";
                    break;
                }

                case 7:
                {
                    createdText += "";
                    break;
                }

                case 8:
                {
                    createdText += "";
                    break;
                }

                /*
                 * case 9:
                 * {
                 *  createdText += "";
                 *  break;
                 * }
                 */
                case 9:
                {
                    createdText += "Kokoushuoneet olivat mukavan näköisiä, mutta jatketaan.";
                    break;
                }

                case 10:
                {
                    createdText += "Kahvihuoneesta on aina harmi lähteä, mutta kierroksen on jatkuttava.";
                    break;
                }

                default:
                {
                    createdText += "Olitte jossain... Olittehan?";
                    break;
                }
                }

                //Main body of text
                switch (l)
                {
                //NoLocation case
                case 0:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[0])
                    {
                        createdText += "NoLocation... Again";
                        break;
                    }
                    else
                    {
                        createdText += "NoLocation";
                        break;
                    }
                }

                //
                case 1:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[1])
                    {
                        createdText += "Olette jälleen aulassa.";
                        break;
                    }
                    else
                    {
                        createdText += "Tämä on Agoran neljännen kerroksen aula. Opatus keskittyy eteläpuoleen, jossa suurin osa tutkimusryhmien tiloista on.";
                        break;
                    }
                }

                //
                case 2:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[2])
                    {
                        createdText += "Vielä ei ole aika VR-kierrokselle. Ehkä vielä myöhemmin.";
                        break;
                    }
                    else
                    {
                        createdText += "Tämä on MR labra. Täällä tehdään uraauurtavaa lisätyn- ja virtuaalitodellisuuden tutkimusta. Tämä on suosittu kohde laitoksen vieraille. Tarvitsette luvan päästä kokeilemaan VR-laseja. Ehkä myöhemmin.";
                        break;
                    }
                }

                //
                case 3:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[3])
                    {
                        createdText += "Ilmaiskappaleita sensoreista ei ole suoraan saatavilla.";
                        break;
                    }
                    else
                    {
                        createdText += "Täällä työskennellään terveysteknologioiden parissa. Tutkimusta tehdään monitieteellisessä yhteistyössä. Esimerkiksi Mikko Pänkäällän tutkimusryhmä on tehnyt ei-invasiivisia, liikeantureihin perustuvia sydämen telemonitorointitekniikoita.";
                        break;
                    }
                }

                //
                case 4:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[4])
                    {
                        createdText += "Unohdin mainita Insinööri Opetustutkimuksesta. Sitä tehdään täällä.";
                        break;
                    }
                    else
                    {
                        createdText += "Sulautettut elektroniikan tutkimus keskittyy täällä “Internet of Things” tutkimukseen, rinnakkais Arkkitehtuureihin ja itsenäisiin sulautettuihin elektroniikkaan. Tilassa työskentelee myös tekoälytutkijoita.";
                        break;
                    }
                }

                //
                case 5:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[5])
                    {
                        createdText += "Skynetin tuleminen ei ole vielä tänään, niin voitte rauhoittua… Luotathan minuun?";
                        break;
                    }
                    else
                    {
                        createdText += "Huoneessa on tietojenkäsittelytieteen tutkijoita tekemässä Data-analytiikaa ja tekoälytutkimusta. Laboratorion tutkimus keskittyy algoritmisuunnittelun ja koneellisenälyn metodeihin ja tekniikoihin.";
                        break;
                    }
                }

                //
                case 6:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[6])
                    {
                        createdText += "Ohjelmistotekniikassa tutkitaan yleisesti ohjelmisto- ja pelikehitystä. Tutkimusta suoritti ennen TUCS:n ohjelmisto kehityslaboratorio(SwDev). ";
                        break;
                    }
                    else
                    {
                        createdText += "Ohjelmistotekniikka ei ole ehtinyt uudistumaan näin nopeasti huolimatta alan maineesta nopeaan kehitykseen.";
                        break;
                    }
                }

                //
                case 7:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[7])
                    {
                        createdText += "Kehittäjät jatkavat väsymättömästi ViLLE järjestelmän ylläpitoa.";
                        break;
                    }
                    else
                    {
                        createdText += "Oppimisanalytiikan tavoitteena on hyödyntää opiskelijoista tallennetua tietoa opetuksen ja oppimisen kehittämiseen. ViLLE-oppimisjärjestelmä kehitettiin heidän toimestaan.";
                        break;
                    }
                }

                //
                case 8:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[8])
                    {
                        createdText += "Neuroverkot kouluttautuvat aktiivisesti ilman apuanne.";
                        break;
                    }
                    else
                    {
                        createdText += "Kieliteknologian ryhmä kouluttaa neuroverkkoja kielitieteellisiin tutkimustarkoituksiin. Yksikön vetäjä on Filip Ginter.";
                        break;
                    }
                }

                /*
                 * case 9:
                 *  {
                 *      //checks if the place has been visited before
                 *      if (realVisitedLocationsBoolean[9])
                 *      {
                 *          createdText += "Tutkimus jatkuu ja kierros kiertyy itseensä.";
                 *          break;
                 *      }
                 *      else
                 *      {
                 *
                 *          createdText += "Bioinformaatikassa tutkitaan tällä hetkellä hiili anhydraatteja (carbonic anhydrases). Välitavoitteena tutkimuksella on löytää todennäköisin historia hiili anhydraattien evoluutiolle.";
                 *          break;
                 *      }
                 *  }
                 */

                case 9:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[9])
                    {
                        createdText += "Tämä ei ole kahvihuone. Eikun on.";
                        break;
                    }
                    else
                    {
                        createdText += "Mänty ja Honka ovat keskeisimmät neuvotteluhuoneet laitoksella. Ne ovat monikäyttöiset ja yhdistettävissä siirrettävien väliseinien kanssa. Niiden läheisyys kahvihuoneeseen tarjoaa mahdollisuuden yhdistää ne suureksi avoimeksi tilaksi.";
                        break;
                    }
                }

                //
                case 10:
                {
                    //checks if the place has been visited before
                    if (visitedLocationsBoolean[10])
                    {
                        createdText += "Biljardiottelu käytiin 2017, ja uusi on kaukana. Noh. Kahvia on aina… Kai?";
                        break;
                    }
                    else
                    {
                        createdText += "Kokoontumispaikka ja kitkeränhajuisen elämänveden keidas. Kahvihuone on enemmän tai vähemmän tapahtumien tilaisuuspaikka.";
                        break;
                    }
                }

                //Default case
                default:
                {
                    createdText += " Jotain kummaa on päässyt tapahtumaan.";
                    break;
                }
                }

                //add random advice for nex location

                createdText += " " + generateRandomLocationAdvice();

                #region old_random_advice_implementation

                /*
                 * old and bugged
                 * //add advice for next location
                 * for (int x = 0; x < visitedLocations.Count; x++)
                 * {
                 *  foreach(StoryEngine.Location temp in Enum.GetValues(typeof(StoryEngine.Location)))
                 *  {
                 *      if(visitedLocations[x] != temp)
                 *      {
                 *          advicePool.Add(locationAdvice[(int)visitedLocations[x]]);
                 *      }
                 *  }
                 * }
                 *
                 * if (advicePool[0] != null)
                 * {
                 *  createdText += advicePool[UnityEngine.Random.Range(0, advicePool.Count - 1)];
                 * }
                 * else
                 * {
                 *  createdText += " You have visited all locations.";
                 * }
                 * //Untested ends
                 */
                #endregion
            }//End of test text generator

            //Part for generating real case texts
            else
            {
                createdText = "Real test Text StoryEngine.";
            }//End of real use test generator

            return(createdText);
        }//end of first if
        else
        {
            return("Nothing");
        }
    }