Ejemplo n.º 1
0
        public bool IsFormEnabled(DeckSerializer deckSerializer)
        {
            if (deckSerializer.HasExtraOptionEnabled(StudyOptions.Option.kPlainForm))
            {
                if (!mEnabledWithPlainSet)
                {
                    return(false);
                }
            }
            else
            {
                if (!mEnabledWithPoliteSet)
                {
                    return(false);
                }
            }

            if (mFormTypeInfo.HasConfig(WordFormConfig.kRequiresOption))
            {
                if (!deckSerializer.HasOptionalWordFormTypeEnabled(mType))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
//public:
        public CardWriterMethodBrainscape(DeckSerializer deckSerializer, Card baseCard, CardKey key)
            : base(deckSerializer, baseCard, key)
        {
            if (baseCard.HasCardType(CardType.kPhrase))
            {
                mSharedPreNote += "[Phrase]";
            }
        }
Ejemplo n.º 3
0
// public:
        public Card(DeckSerializer deckSerializer, Deck originalParentDeck, List <string> line)
        {
            mDeckSerializer    = deckSerializer;
            mBookAndChapterNum = originalParentDeck.GetBookAndChapterNumber();

            InitializeCardTypes(line[0]);
            InitializeKana(line[1]);
            InitializeKanji(line[2]);
            mEnglish          = line[3];
            mExtraInformation = line[4];

            if (mCardTypes.Contains(CardType.kVerb))
            {
                if (HasCardType(CardType.kVerbGodan) || HasCardType(CardType.kVerbIchidan) || HasCardType(CardType.kVerbSuru))
                {
                    InitializeVerbJishoFromType();
                    InitializeVerbForms();
                }
                else if (mKana.Equals("いらっしゃいます"))
                {
                    // Very special case and most of the variations are unused
                    InitializeIrashaiVerb();
                }
                else
                {
                    throw new Exception(string.Format("\"{0}\" : Listed as a verb, but with no identifiable type", mKana));
                }
            }

            if (mCardTypes.Contains(CardType.kAdjectiveNa))
            {
                InitializeAdjectiveNaForms();
            }

            if (mCardTypes.Contains(CardType.kAdjectiveI))
            {
                InitializeAdjectiveIForms();
            }
        }
Ejemplo n.º 4
0
// public:
        public Deck(DeckSerializer deckSerializer)
        {
            mDeckSerializer = deckSerializer;
        }
Ejemplo n.º 5
0
//public:
        public CardWriterMethodCardTypeInfo(DeckSerializer deckSerializer, Card baseCard, CardKey key)
            : base(deckSerializer, baseCard, key)
        {
        }
Ejemplo n.º 6
0
//protected:
        protected CardWriterMethod(DeckSerializer deckSerializer, Card baseCard, CardKey key)
        {
            mDeckSerializer = deckSerializer;
            AttachCard(baseCard);
            mCardKey = key;
        }
Ejemplo n.º 7
0
//public://static
        public static CardWriterMethod CreateWriterMethod(CardWriterFormat cardWriterFormat, DeckSerializer deckSerializer, Card baseCard, CardKey key)
        {
            switch (cardWriterFormat)
            {
            case CardWriterFormat.kBrainscape:
                return(new CardWriterMethodBrainscape(deckSerializer, baseCard, key));

            case CardWriterFormat.kCardTypeInfo:
                return(new CardWriterMethodCardTypeInfo(deckSerializer, baseCard, key));
            }
            return(null);
        }