Example #1
0
        /**
         * Get all items with where the owner field is equal to that of the players name
         * @param owner the entity to whom the items belong.
         */
        public String GetOwnedItems(String owner)
        {
            String rString = U.NL("");
            var    command = new sqliteCommand("select * from " + itemTableName + " where owner =:name ", Database);

            command.Parameters.Add("name", DbType.String).Value = owner;

            try
            {
                var reader = command.ExecuteReader();
                while (reader.Read())
                {
                    //make the description
                    String id = reader["itemID"].ToString();
                    rString += U.NL("Name: " + gameObjectList.GetItem(id).itemName);
                    rString += U.NL("Description: " + gameObjectList.GetItem(id).description);
                    U.NL("");
                }
            }
            catch (Exception ex)
            {
                Console.Write("Failed to get inventory" + ex);
                rString += "Could not find items";
            }
            return(rString);
        }
Example #2
0
 public static GameObject GetItem(string name)
 {
     return(gameObjectList.GetItem(name));
 }