Пример #1
0
 // alarmSimulator bruker databaseModule til å hente ut alle SauID i systemet, velger vilkårlig om den skal sende en alarm, velger vilkårlig
 // hvilken av sauene det skal være, og så skriver vi bare en Healthlog til den sauen.
 public AlarmSimulator(int tickLimit, DatabaseModule databaseModule, Authentication rootUser )
     : base(tickLimit, databaseModule, rootUser)
 {
     // På ingen måter ferdig implementert, men prøver å vise hvordan jeg tenker. Gi gjerne tilbakemelding
     Random rnd = new Random();
     List<int> sauIDer = databaseModule.LoadAllSheepIDs();
     int unluckySheep = rnd.Next(sauIDer.Count);
     int helseBPM = rnd.Next(45);
     float temp = 0;
        // databaseModule.SetHealth(sauIDer.ElementAt(unluckySheep), helseBPM, temp);
 }
Пример #2
0
 public Authentication AdminLogin(Authentication adminAuthentication)
 {
     throw new NotImplementedException();
 }
Пример #3
0
        public bool NormalLogin(Authentication authentication)
        {
            command = connection.CreateCommand();
            command.CommandText = "SELECT BondeID FROM login WHERE epost='" + authentication.Username + "' && passord='" +
                                  authentication.Password + "';";
            reader = command.ExecuteReader();

            while (reader.Read())
            {
                IDataReader record = reader;
                authentication.FarmerID = int.Parse("" + record[0]);
            }
            reader.Close();

            return authentication.FarmerID != -1;
        }
Пример #4
0
 public MotionSimulator(int triggerLimit, DatabaseModule databaseModule, Authentication rootUser, Position standardPosition, int movement)
     : base(triggerLimit, databaseModule, rootUser)
 {
     this.standardPosition = standardPosition;
     this.movement = movement;
 }
Пример #5
0
 public Simulator(int triggerLimit, DatabaseModule databaseModule, Authentication rootUser)
 {
     this.databaseModule = databaseModule;
     this.tickLimit = triggerLimit;
     this.rootUser = rootUser;
     this.tickCounter = 0;
 }