Example #1
0
    public CharLetter GetLetter(char c)
    {
        if (list.ContainsKey(c))
        {
            return(list[c]);
        }
        var unUsedletter = new CharLetter(c);

        list.Add(c, unUsedletter);

        return(unUsedletter);
    }
Example #2
0
    public CharLetter GetLetter(char c)
    {
        if (_list.ContainsKey(c))
        {
            return(_list[c]);                  //keyがあればvalueを返す
        }
        var unUsedletter = new CharLetter(c);  //なければ生成する

        _list.Add(c, unUsedletter);

        return(unUsedletter);
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        var document = "iamaman";
        var chars    = document.ToCharArray();

        var letterFactory = new LetterFactory();

        foreach (var c in chars)
        {
            CharLetter charletter = letterFactory.GetLetter(c);
            ShowCharLetter(charletter);
        }
    }
Example #4
0
    void Start()
    {
        var document = "iamaman";
        var chars    = document.ToCharArray();

        var letterFactory = LetterFactory.GetInstance();

        foreach (var c in chars)
        {
            CharLetter charLetter = letterFactory.GetLetter(c);
            charLetter.ShowCharLetter();
        }
    }
Example #5
0
 private void ShowCharLetter(CharLetter letter)
 {
     Debug.Log(letter.Singleletter);
 }