Пример #1
0
 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
            };
        }
Пример #4
0
 public ClassRepository(IDBModel db)
 {
     _db = db;
 }
 public TeacherRepository(IDBModel testManageDB)
 {
     db = testManageDB;
 }
Пример #6
0
    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;
 }
Пример #10
0
    public WarningController warningController; /*!<memanggil script warningController*/

    void Start()
    {
        AllInputComponent = new InputField[] { username, password };

        sDataModel = GameObject.FindGameObjectWithTag(HashTag.S_DATA_MODEL).GetComponent <IDBModel>();
    }
Пример #11
0
 public StudentRepository(IDBModel db)
 {
     _db = db;
 }
Пример #12
0
 public MainPresenter(IMainView view, IDBModel model)
 {
     _view       = view;
     _model      = model;
     _view.Exit += new EventHandler(Exit);
 }
Пример #13
0
 public SubjectRepository(IDBModel testManageDB)
 {
     db = testManageDB;
 }
Пример #14
0
 public User(IDBModel dbModel, Int32 userId)
 {
     DataTable data = dbModel.LoadUser(userId);
     // assign properties.. load any additional data as necessary
 }