public LoginPresentor(ILoginView view, IDBModel model) { _view = view; _model = model; _view.LogIn += new EventHandler(LogIn); _view.Exit += new EventHandler(Exit); }
public IModel Map(IDBModel model) { var proto = model as ProtoPetModel; proto.Dal = Dal; if (proto == null) return null; var now = DateTime.Now; var delta = (float) ((now - proto.LastChangeDate).TotalSeconds); var happinessReduction = proto.HappinessDecay*delta; var hungerIncrease = proto.HungerDecay*delta; //floats clamp var happiness = proto.Happiness - happinessReduction; var hunger = proto.Hunger + hungerIncrease; return new PetModel { Name = proto.Name, ID = proto.ID, OwnerID = proto.OwnerID, Happiness = happiness, Hunger = hunger, Type = proto.Type, LastChangeDate = proto.LastChangeDate, HappinessDecay = proto.HappinessDecay, HungerDecay = proto.HungerDecay }; }
public IModel Map(IDBModel model) { var proto = model as ProtoUserModel; proto.Dal = Dal; if (proto == null) return null; return new UserModel { ID = proto.ID, Username = proto.Username, Password = proto.Password, Pets = proto.Pets }; }
public ClassRepository(IDBModel db) { _db = db; }
public TeacherRepository(IDBModel testManageDB) { db = testManageDB; }
public RegisterAndLoginController registerAndLoginController; /*!< pemanggilan script contoller pemanggil login canvas dan register canvas */ void Start() { s_dataModel = GameObject.FindGameObjectWithTag(HashTag.S_DATA_MODEL).GetComponent <IDBModel>(); EmptyAllInputText(); }
public AnswerRepository(IDBModel testManageDB) { db = testManageDB; }
public QuestionRepository(IDBModel testManageDB) { db = testManageDB; }
public bool Applicable(IDBModel model) { return model is ProtoPetModel; }
public WarningController warningController; /*!<memanggil script warningController*/ void Start() { AllInputComponent = new InputField[] { username, password }; sDataModel = GameObject.FindGameObjectWithTag(HashTag.S_DATA_MODEL).GetComponent <IDBModel>(); }
public StudentRepository(IDBModel db) { _db = db; }
public MainPresenter(IMainView view, IDBModel model) { _view = view; _model = model; _view.Exit += new EventHandler(Exit); }
public SubjectRepository(IDBModel testManageDB) { db = testManageDB; }
public User(IDBModel dbModel, Int32 userId) { DataTable data = dbModel.LoadUser(userId); // assign properties.. load any additional data as necessary }