コード例 #1
0
        public NewMonsterPage(MonsterDBModel monster)
        {
            InitializeComponent();
            itemview = new DBMonsterController();
            Title    = "Edit Monster";
            Monster  = monster;

            BindingContext = this;
        }
コード例 #2
0
        public NewMonsterPage()
        {
            InitializeComponent();
            itemview = new DBMonsterController();
            Title    = "New Item";
            Monster  = new MonsterDBModel
            {
                Name  = "monster name",
                Image = "image uri"
            };

            BindingContext = this;
        }
コード例 #3
0
        private Monster generateMonster(int level)
        {
            // initiate new db connection
            DBMonsterController db = new DBMonsterController();
            // get number of entries
            int max = db.getCount();
            // rng an id to grab
            Random rand = new Random();
            int    id   = rand.Next(1, max);
            //get that monster from the db
            MonsterDBModel m = db.getMonster(id);

            // generate new monster
            return(new Monster(m.Name, m.Image, m.Str, m.Def, m.Dex, m.Health, level, m.ExpValue));
        }
コード例 #4
0
 public MonsterDetailViewModel(MonsterDBModel monster = null)
 {
     Title   = monster.Name;
     Monster = monster;
 }