// 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); }
public Authentication AdminLogin(Authentication adminAuthentication) { throw new NotImplementedException(); }
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; }
public MotionSimulator(int triggerLimit, DatabaseModule databaseModule, Authentication rootUser, Position standardPosition, int movement) : base(triggerLimit, databaseModule, rootUser) { this.standardPosition = standardPosition; this.movement = movement; }
public Simulator(int triggerLimit, DatabaseModule databaseModule, Authentication rootUser) { this.databaseModule = databaseModule; this.tickLimit = triggerLimit; this.rootUser = rootUser; this.tickCounter = 0; }