예제 #1
0
/*
 *  //konstruktor
 *  //in: headline, author, zeitung, datum und ort als string.
 *  //wahrheitswert ob news fake ist oder nicht.
 *  //rossort (politik, wissenschaft und so)
 *  //error string noch nicht herausgefunden
 *  public News(string headline,
 *              string author,
 *              string newspaper,
 *              string date,
 *              string location,
 *              string ressort,
 *              Inconsistency conflict){
 *
 *      info.Add(InfoType.headline, new Info(InfoType.headline, headline));
 *      info.Add(InfoType.author, new Info(InfoType.author, author));
 *      info.Add(InfoType.paper, new Info(InfoType.paper, newspaper));
 *      info.Add(InfoType.date, new Info(InfoType.date, date));
 *      info.Add(InfoType.place, new Info(InfoType.place, location));
 *      info.Add(InfoType.ressort, new Info(InfoType.ressort, ressort));
 *      this.conflict = conflict;
 *  }*/

    public News(string headline,
                string author,
                string newspaper,
                string date,
                string location,
                bool isFake,
                string ressort,
                string error)
    {
        info = new Dictionary <InfoType, Info>();
        info.Add(InfoType.headline, new Info(InfoType.headline, headline));
        info.Add(InfoType.author, new Info(InfoType.author, author));
        info.Add(InfoType.paper, new Info(InfoType.paper, newspaper));
        info.Add(InfoType.date, new Info(InfoType.date, date));
        info.Add(InfoType.place, new Info(InfoType.place, location));
        info.Add(InfoType.ressort, new Info(InfoType.ressort, ressort));

        if (isFake)
        {
            LogSystem.LogOnFile("Generating new news with error: " + error);
            conflict = new Inconsistency(error);
        }
        else
        {
            conflict = new Inconsistency(false);
        }
    }
예제 #2
0
파일: Logo.cs 프로젝트: greenBene/FakeWatch
 // Use this for initialization
 void Start()
 {
     logo = GetComponent <Image>();
     LogSystem.LogOnFile("Game is Played in " + PlayerPrefs.GetString("language"));
     if (PlayerPrefs.GetString("language") == "german")
     {
         logo.sprite = logoGerman;
     }
     else
     {
         logo.sprite = logoEnglish;
     }
 }
예제 #3
0
    public void NewMessage(Inconsistency handle)
    {
        MessengerWindow newMessenger = Instantiate(MessengerPrefab, GameManager.MainScreen.transform).GetComponent <MessengerWindow>();
        string          message      = generator.GetMessage(handle);
        float           moveHight    = newMessenger.Show(message);

        foreach (MessengerWindow it in WindowList)
        {
            it.SlideUp(moveHight);
        }

        WindowList.Add(newMessenger);
        LogSystem.LogOnFile("New Message: " + message + " (based on inconsitency " + handle.info1.value + " <-> " + handle.info2.value + ")");
        LogSystem.LogOnFile("Messages on Screen: " + WindowList.Count);
    }
예제 #4
0
    public void MarkAs(bool correct)
    {
        LogSystem.LogOnFile("(N = " + !news.IsFake() + " |P = " + correct + ") " + news.ToString());
        AudioSource source = GetComponent <AudioSource>();

        if (news.IsFake() != correct)
        {
            source.clip = correctSound;
        }
        else
        {
            source.clip = wrongSound;
            GameManager.MessengerHandler.NewMessage(news.conflict);
        }
        source.Play();
        GameManager.Instance.Score(!news.IsFake(), correct);
        GameManager.NewsSource.RegisterSolvedNews();
        base.Destroy(source.clip.length);
    }
예제 #5
0
    public Dictionary <string, string> FindInvalid(List <string> symbols, Dictionary <string, string> existingConstraints)
    {
        symbols.Shuffle();
        var cats = new List <Category>(symbols.Select(s => symbolToCategory[s]));

        foreach (var cat in cats)
        {
            cat.Shuffle();
            if (CatCatToId.data.ContainsKey(cat))
            {
                foreach (var otherCat in CatCatToId.data[cat].Keys)
                {
                    if (!cats.Contains(otherCat) && !existingConstraints.ContainsKey(otherCat.symbol))
                    {
                        continue;
                    }
                    cat.inverseMemberTruth(otherCat);
                    otherCat.inverseMemberTruth(cat);
                    // TODO: CREATE EXACT OPPOSITE RULES
                    var solution = FindValid(cats, existingConstraints);
                    // Put original rules back in place
                    cat.inverseMemberTruth(otherCat);
                    otherCat.inverseMemberTruth(cat);
                    if (solution != null)
                    {
                        string t1 = cat.symbol;
                        string t2 = otherCat.symbol;
                        string s1, s2;
                        solution.TryGetValue(t1, out s1);
                        solution.TryGetValue(t2, out s2);

                        //solution.TryGetValue(s2, out s2);
                        solution["ERROR"] = String.Format("{0}|{1}|{2}|{3}", t1, s1, t2, s2);
                        LogSystem.LogOnFile(solution["ERROR"]);
                        return(solution);
                    }
                }
            }
        }
        return(null);
    }
예제 #6
0
 private void UpdateText()
 {
     text.text = RESSOURCE_NAME + ": " + ressource;
     LogSystem.LogOnFile(text.text);
 }
예제 #7
0
    bool ChangeState(GameState newState)
    {
        if (state == newState)
        {
            return(false);
        }

        switch (state)   //by exiting this state
        {
        case GameState.Desktop:
            break;

        case GameState.Tutorial:
            if (tutorial)
            {
                tutorial.AbortTutorial();
            }
            //else
            //tutorialFlag += tutorial.AbortTutorial;//TODO: flag setzten
            break;

        case GameState.Playing:
            LogSystem.LogOnFile("===== ===== Game has Ended ===== =====");
            NewsSource.StopGeneration();
            GameManager.MessengerHandler.DeleteAllMessages();
            if (timer)
            {
                timer.ChangeStateToTimeShort();
            }
            //else
            //timerFlag += timer.ChangeStateToTimeShort;//TODO: flag setzten
            break;

        case GameState.EndScreen:
            if (end)
            {
                end.Close();
            }
            correctMarkedArticles        = 0;
            wronglyMarkedArticlesAsFalse = 0;
            wronglyMarkedArticlesAsTrue  = 0;
            break;

        default:
            break;
        }

        state = newState;

        switch (state)   //by entering this state
        {
        case GameState.Desktop:
            break;

        case GameState.Tutorial:
            PlayerID = Random.Range(0, 9999999);
            LogSystem.LogOnNewFile("===== ===== Started Tutorial ===== =====");
            LogSystem.LogOnFile("PlayerID = " + PlayerID);
            if (tutorial)
            {
                tutorial.StartTutorial();
            }
            //else
            //tutorialFlag += tutorial.StartTutorial;//TODO: flag setzten
            break;

        case GameState.Playing:
            timeLeft = timeToPlayInSeconds;
            LogSystem.LogOnFile("===== ===== New Game Started ===== =====");
            NewsSource.StartGeneration();
            if (timer)
            {
                timer.ChangeStateToCountdown();
            }
            //else
            //timerFlag += timer.ChangeStateToCountdown;//TODO: flag setzten
            ProgressionManager.RestartCounter();
            break;

        case GameState.EndScreen:
            LogSystem.LogOnFile("Correct: " + correctMarkedArticles + ". False positive: " + wronglyMarkedArticlesAsTrue + ". False negative: " + wronglyMarkedArticlesAsFalse);
            if (end)
            {
                end.Show();
            }
            break;

        default:
            break;
        }
        return(true);
    }
예제 #8
0
 public void SkipTutorial()
 {
     LogSystem.LogOnFile("Skiped Tutorial at Window number: " + (index + 1));
     GameManager.Instance.RequestStateChange(EventTrigger.Tutorial, EventMessage.Scip);
 }
예제 #9
0
 public void ExitTutorial()
 {
     LogSystem.LogOnFile("Exited Tutorial at Window number: " + (index + 1));
     GameManager.Instance.RequestStateChange(EventTrigger.Tutorial, EventMessage.Failed);
 }
예제 #10
0
 public override void Show()
 {
     base.Show();
     LogSystem.LogOnFile("Creadits got opened");
     SetPosition(Screen.width / 2, Screen.height / 2);
 }