public NewMonsterPage(MonsterDBModel monster) { InitializeComponent(); itemview = new DBMonsterController(); Title = "Edit Monster"; Monster = monster; BindingContext = this; }
public NewMonsterPage() { InitializeComponent(); itemview = new DBMonsterController(); Title = "New Item"; Monster = new MonsterDBModel { Name = "monster name", Image = "image uri" }; BindingContext = this; }
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)); }
public MonsterDetailViewModel(MonsterDBModel monster = null) { Title = monster.Name; Monster = monster; }