Exemple #1
0
        /// <summary>
        /// Writes a BaseLanguage object to the database
        /// </summary>
        /// <returns>bool indicating success</returns>
        /// <param name="gameID">Game (bucket) to write to</param>
        /// <param name="bl">BaseLanguage to write</param>
        public static bool DatabaseWrite_BaseLanguage(string gameID, BaseLanguage bl)
        {
            var rBaseLanguage         = new RiakObject(gameID, bl.id, bl);
            var putBaseLanguageResult = Globals_Server.rClient.Put(rBaseLanguage);

            if (!putBaseLanguageResult.IsSuccess)
            {
                Globals_Server.logError("Write failed: BaseLanguage " + rBaseLanguage.Key + " to bucket " + rBaseLanguage.Bucket);
            }

            return(putBaseLanguageResult.IsSuccess);
        }
Exemple #2
0
        /// <summary>
        /// Constructor for Language
        /// </summary>
        /// <param name="bLang">BaseLanguage for the language</param>
        /// <param name="dial">int holding language dialect code</param>
        public Language(BaseLanguage bLang, int dial)
        {
            // VALIDATION

            // DIALECT
            if (dial < 1)
            {
                throw new InvalidDataException("Language dialect code must be an integer >= 0");
            }

            this.baseLanguage = bLang;
            this.dialect      = dial;
            this.id           = this.baseLanguage.id + this.dialect;
        }
Exemple #3
0
 public ClientBaseLanguage(BaseLanguage b)
 {
     this.id   = b.id;
     this.name = b.name;
 }