public bool Undo() { if (PlayTime.Count <= 0) { return(false); } var point = PlayTime.Pop(); var btn = ListButon[point.Point.Y][point.Point.X]; btn.BackgroundImage = null; if (PlayTime.Count <= 0) { PlayerNewPerson = 0; } else { point = PlayTime.Peek(); playerNewPerson = playerNewPerson == 1 ? 0 : 1; } changePlayer(); return(true); }
static public bool is_Valid_projc_time(DateTime projectionTime, long langthTicks) { movieDBConnection db = new movieDBConnection(); List <PlayTime> closestTime = db.PlayTimes.OrderBy(t => t.play).ToList(); if (closestTime.Count == 0) { return(true); } PlayTime close = closestTime[0]; long min = Math.Abs((close.play - projectionTime).Ticks); foreach (PlayTime x in closestTime) { if (Math.Abs((x.play - projectionTime).Ticks) < min) { min = Math.Abs((x.play - projectionTime).Ticks); close = x; } } long duration = (close.play < projectionTime) ? new TimeSpan(0, close.Movie.langth, 0).Ticks : langthTicks; if (Math.Abs((close.play - projectionTime).Ticks) < duration) { return(false); } return(true); }
public static PlayTime extractPlayTime(String filePath) { VideoFileReader videoFileReader = new VideoFileReader(filePath); PlayTime playTime = extractPlayTime(videoFileReader); videoFileReader.dispose(); videoFileReader = null; return(playTime); }
// PUT api/<controller>/5 public CustomerBuyTicket Put(CustomerBuyTicket cbt) { movieDBConnection db = new movieDBConnection(); db.CustomerBuyTickets.Add(cbt); PlayTime p = db.PlayTimes.SingleOrDefault(x => x.id == cbt.playTime_id); p.availble_sits = p.availble_sits - (int)cbt.amount; db.SaveChanges(); return(cbt); }
public List <PlayTime> GetListPlayTime() { List <PlayTime> list = new List <PlayTime>(); string query = " SELECT * FROM PlayTime "; DataTable data = DataProvider.Instance.ExecuteQuery(query); foreach (DataRow item in data.Rows) { PlayTime playTime = new PlayTime(item); list.Add(playTime); } return(list); }
public List <PlayTime> SearchPlayTimeNotAir() { List <PlayTime> list = new List <PlayTime>(); DataTable data = DataProvider.Instance.ExecuteQuery(" SELECT * FROM PlayTime WHERE StatusPlayTime = N'Không máy lạnh' "); foreach (DataRow item in data.Rows) { PlayTime playTime = new PlayTime(item); list.Add(playTime); } return(list); }
// DELETE api/<controller>/5 public void Delete(int id) { movieDBConnection db = new movieDBConnection(); CustomerBuyTicket cbt = db.CustomerBuyTickets.SingleOrDefault(x => x.id == id); db.CustomerBuyTickets.Remove(cbt); PlayTime p = db.PlayTimes.SingleOrDefault(x => x.id == cbt.playTime_id); p.availble_sits = p.availble_sits + (int)cbt.amount; db.SaveChanges(); }
private void LoadStats() { string path = "data/_stats.ini"; Shoots = "0"; Kills = "0"; Headshots = "0"; Winrate = "0 %"; Accuracy = "0 % "; KPS = "0.00"; PlayTime = "00:00:00"; Games = "0"; Score = "0"; try { StreamReader sr = new StreamReader(path, Encoding.Default); const int STATS_N = 7; string[] stats = new string[STATS_N]; // Выстрелов, убийств, в голову, побед, поражений, время, счёт for (int i = 0; i < STATS_N; i++) { stats[i] = sr.ReadLine(); } sr.Close(); Shoots = stats[0]; Kills = stats[1]; Headshots = stats[2]; Winrate = (Convert.ToInt32(stats[3]) * 100 / (Convert.ToInt32(stats[3]) + Convert.ToInt32(stats[4]))).ToString() + "%"; Accuracy = (Convert.ToInt32(stats[1]) * 100 / (Convert.ToInt32(stats[0]))).ToString() + "%"; KPS = (Convert.ToInt32(stats[1]) / ((double)Convert.ToInt32(stats[5]) / 1000)).ToString("0.##"); PlayTime = Timer.ConvertToTime(Convert.ToInt32(stats[5])); if (PlayTime.Length == 8) { PlayTime = "00:" + PlayTime.Substring(0, 5); } else { PlayTime = PlayTime.Substring(0, 8); } Games = (Convert.ToInt32(stats[3]) + Convert.ToInt32(stats[4])).ToString(); Score = stats[6]; } catch { } }
private void Play(object sender, EventArgs e) { PlayTime -= 1; TimeBox.Text = PlayTime.ToString(); if (PlayTime < 0) { timerMove.Stop(); timerPlay.Stop(); TimeBox.Text = ""; LetterBox.Text = ""; MessageBox.Show("Поздравляем, вы набрали: " + Score.ToString() + " очков"); WriteRecords(); } }
public override int GetHashCode() { unchecked { var hashCode = (TeamId != null ? TeamId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Location != null ? Location.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)Division; hashCode = (hashCode * 397) ^ (Tier != null ? Tier.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ImageCount; hashCode = (hashCode * 397) ^ PlayTime.GetHashCode(); hashCode = (hashCode * 397) ^ TotalScore.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Warnings; hashCode = (hashCode * 397) ^ (Advancement != null ? Advancement.GetHashCode() : 0); return(hashCode); } }
public async Task <ActionResult <PlayTime> > Play(int id, PlayTime playtime) { var pet = await _context.Pets.FindAsync(id); if (pet == null) { return(NotFound()); } pet.HappinessLevel += 5; pet.HungerLevel += 3; playtime.When = DateTime.Now; playtime.PetId = pet.Id; _context.PlayTime.Add(playtime); await _context.SaveChangesAsync(); return(Ok(playtime)); }
void Awake() { if (Instance) { Destroy(Instance); } Instance = this; // check InscopeStudio TextTimer = GetComponent <Text>(); //? maybe in Start if (GameSettings.Instance.ContinuePreviousGame) { deltaTime = Config.ReadGameTime(); } else { deltaTime = 0; } }
private void Play(object sender, EventArgs e) { PlayTime -= 1; TimeBox.Text = PlayTime.ToString(); if (PlayTime < 0) { timerMove.Stop(); timerPlay.Stop(); TimeBox.Text = ""; LetterBox.Text = ""; if (Common.IsHost) { MessageBox.Show("Поздравляем, вы набрали: " + Score1.ToString() + " очков"); MessageBox.Show("Ваш противник набрал: " + Score2.ToString() + " очков"); } else { MessageBox.Show("Поздравляем, вы набрали: " + Score2.ToString() + " очков"); MessageBox.Show("Ваш противник набрал: " + Score1.ToString() + " очков"); } } }
public async Task <ActionResult <PlayTime> > CreatePlayTimeForPet(int id, PlayTime playTime) { var pet = await _context.Pets.FindAsync(id); if (pet == null) { return(NotFound()); } playTime.PetId = pet.Id; var updateHappiness = pet.HappinessLevel + 5; pet.HappinessLevel = updateHappiness; var updateHunger = pet.HungerLevel + 3; pet.HungerLevel = updateHunger; _context.PlayTimes.Add(playTime); await _context.SaveChangesAsync(); return(Ok(playTime)); }
//When Wake Play void Awake() { playtime = FindObjectOfType(typeof(PlayTime)) as PlayTime; }
public int Update(PlayTime time) { this.playTimesRepo.Update(time); return(this.context.Commit()); }
// PUT api/<controller>/5 public HttpResponseMessage Put() { movieDBConnection db = new movieDBConnection(); // init Movie string st = HttpContext.Current.Request.Params["movie"]; Movie mv; try { mv = JsonConvert.DeserializeObject <Movie>(st); mv.img = "first_img.JPG"; } catch { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "חסרים נתונים בסרט")); } // init playTimes - List <PlayTime> playTList = new List <PlayTime>(); int numOfProj = Convert.ToInt32(HttpContext.Current.Request.Params["numOfProj"]); for (int i = 0; i < numOfProj; i++) { PlayTime pt = new PlayTime(); pt.movie_id = mv.id; DateTime temp; //check valid date string if (!DateTime.TryParse(HttpContext.Current.Request.Params["projection" + i], out temp)) { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "זמן הקרנה לא חוקי")); } pt.play = temp; pt.total_sits = Convert.ToInt32(HttpContext.Current.Request.Params["sits"]); pt.availble_sits = pt.total_sits; // check if projection time is valid if (!PlayTimeController.is_Valid_projc_time(pt.play, new TimeSpan(0, mv.langth, 0).Ticks)) { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "זמן ההקרנה המבוקש תפוס")); } playTList.Add(pt); } mv.PlayTimes = playTList; // save on dataBase try { db.Movies.Add(mv); db.SaveChanges(); } catch { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "בעיה בגישה למס''ד נתונים \n פעולה לא התבצעה")); } // handle Image HttpPostedFile img = HttpContext.Current.Request.Files["img"]; if (img != null) { try { mv.img = mv.id + Path.GetExtension(img.FileName); db.SaveChanges(); // save Image on server img.SaveAs(HttpContext.Current.Server.MapPath("~/images/") + mv.img); } catch { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "בעיה בשמירת תמונה \n לא נשמרה תמונה")); } } return(Request.CreateResponse(HttpStatusCode.OK, "הסרט נוסף בהצלחה")); }
public void Save(string Key) { bool found = false; string OutputFile = "./Database/Users/" + Name + "/Info.Dat"; Utilities.IO.PrepareDirectory("./Database/"); Utilities.IO.PrepareDirectory("./Database/Users/"); Utilities.IO.PrepareDirectory("./Database/Users/" + Name); Utilities.IO.PrepareFile(OutputFile); string[] OutputFileContents = Utilities.IO.ReadAllLines(OutputFile); string OutTime = Utilities.DateTimeUtilities.ToYearTimeDescending(Utilities.DateTimeUtilities.FormatDateTime(DateTime.Now)); List <String> Output = new List <String>(); foreach (string line in OutputFileContents) { #region GetDataCouplets string ThisLine = line; if (!(ThisLine.Contains("\t"))) { Output.Add(line); continue; } while (ThisLine.Contains("\t\t")) { ThisLine = ThisLine.Replace("\t\t", "\t"); } string Header = ThisLine.Split('\t')[0]; string Data = ThisLine.Remove(0, ((Header.Length) + 1)); var Converted = Utilities.IO.StringToVariable(Data); //NOTE: These WILL Bypass GUI mode if enabled, as the GUI setting is turned on until it is read. //if (Converted is Boolean) Logger.Console.WriteLine(String.Format("Bool: {0}", Data)); //if (Converted is IPAddress) Logger.Console.WriteLine(String.Format("IPAddress: {0}", Data)); //if (Converted is Decimal) Logger.Console.WriteLine(String.Format("Decimal: {0}", Data)); //if (Converted is Int32) Logger.Console.WriteLine(String.Format("Int32: {0}", Data)); //if (Converted is String) Logger.Console.WriteLine(String.Format("String: {0}", Data)); #endregion if (Key.ToUpperInvariant() != Header.ToUpperInvariant()) { Output.Add(line); continue; } switch (Header.ToUpperInvariant()) { #region Switches case Strings.Name: Output.Add(Strings.Name + "\t\t" + Name); found = true; break; case Strings.DisplayedName: Output.Add(Strings.DisplayedName + "\t\t" + DisplayedName.ToString()); found = true; break; case Strings.LastIP: Output.Add(Strings.LastIP + "\t\t\t" + LastIP.ToString()); found = true; break; case Strings.LoginCount: Output.Add(Strings.LoginCount + "\t\t" + LoginCount.ToString()); found = true; break; case Strings.MessagesTyped: Output.Add(Strings.MessagesTyped + "\t\t" + MessagesTyped.ToString()); found = true; break; case Strings.DateJoined: Output.Add(Strings.DateJoined + "\t\t" + DateJoined.ToString()); found = true; break; case Strings.DateLastVisited: Output.Add(Strings.DateLastVisited + "\t\t" + DateLastVisited.ToString()); found = true; break; case Strings.PlayTime: Output.Add(Strings.PlayTime + "\t\t" + PlayTime.ToString()); found = true; break; case Strings.Kills: Output.Add(Strings.Kills + "\t\t\t" + Kills.ToString()); found = true; break; case Strings.Deaths: Output.Add(Strings.Deaths + "\t\t\t" + Deaths.ToString()); found = true; break; case Strings.FlightsFlown: Output.Add(Strings.FlightsFlown + "\t\t" + FlightsFlown.ToString()); found = true; break; case Strings.FlightHours: Output.Add(Strings.FlightHours + "\t\t" + FlightHours.ToString()); found = true; break; case Strings.Banned: Output.Add(Strings.Banned + "\t\t\t" + Banned.ToString()); found = true; break; case Strings.BannedBy: Output.Add(Strings.BannedBy + "\t\t" + BannedBy.ToString()); found = true; break; case Strings.DateBanned: Output.Add(Strings.DateBanned + "\t\t" + DateBanned.ToString()); found = true; break; case Strings.BanExpires: Output.Add(Strings.BanExpires + "\t\t" + BanExpires.ToString()); found = true; break; case Strings.BanReason: Output.Add(Strings.BanReason + "\t\t" + BanReason.ToString()); found = true; break; case Strings.TimesBanned: Output.Add(Strings.TimesBanned + "\t\t" + TimesBanned.ToString()); found = true; break; case Strings.Frozen: Output.Add(Strings.Frozen + "\t\t\t" + Frozen.ToString()); found = true; break; case Strings.FrozenBy: Output.Add(Strings.FrozenBy + "\t\t" + FrozenBy.ToString()); found = true; break; case Strings.DateFrozen: Output.Add(Strings.DateFrozen + "\t\t" + DateFrozen.ToString()); found = true; break; case Strings.FreezeExpires: Output.Add(Strings.FreezeExpires + "\t\t" + FreezeExpires.ToString()); found = true; break; case Strings.FreezeReason: Output.Add(Strings.FreezeReason + "\t\t" + FreezeReason.ToString()); found = true; break; case Strings.TimesFrozen: Output.Add(Strings.TimesFrozen + "\t\t" + TimesFrozen.ToString()); found = true; break; case Strings.Muted: Output.Add(Strings.Muted + "\t\t\t" + Muted.ToString()); found = true; break; case Strings.MutedBy: Output.Add(Strings.MutedBy + "\t\t\t" + MutedBy.ToString()); found = true; break; case Strings.DateMuted: Output.Add(Strings.DateMuted + "\t\t" + DateMuted.ToString()); found = true; break; case Strings.MuteExpires: Output.Add(Strings.MuteExpires + "\t\t" + MuteExpires.ToString()); found = true; break; case Strings.MuteReason: Output.Add(Strings.MuteReason + "\t\t" + MuteReason.ToString()); found = true; break; case Strings.TimesMuted: Output.Add(Strings.TimesMuted + "\t\t" + TimesMuted.ToString()); found = true; break; case Strings.Kicked: Output.Add(Strings.Kicked + "\t\t\t" + Kicked.ToString()); found = true; break; case Strings.KickedBy: Output.Add(Strings.KickedBy + "\t\t" + KickedBy.ToString()); found = true; break; case Strings.DateKicked: Output.Add(Strings.DateKicked + "\t\t" + DateKicked.ToString()); found = true; break; case Strings.KickReason: Output.Add(Strings.KickReason + "\t\t" + KickReason.ToString()); found = true; break; case Strings.TimesKicked: Output.Add(Strings.TimesKicked + "\t\t" + TimesKicked.ToString()); found = true; break; case Strings.OthersBanned: Output.Add(Strings.OthersBanned + "\t\t" + OthersBanned.ToString()); found = true; break; case Strings.OthersFrozen: Output.Add(Strings.OthersFrozen + "\t\t" + OthersFrozen.ToString()); found = true; break; case Strings.OthersMuted: Output.Add(Strings.OthersMuted + "\t\t" + OthersMuted.ToString()); found = true; break; case Strings.OthersKicked: Output.Add(Strings.OthersKicked + "\t\t" + OthersKicked.ToString()); found = true; break; case Strings.GroupRepresented: Output.Add(Strings.GroupRepresented + "\t" + GroupRepresented.ToString()); found = true; break; #endregion default: Logger.Log.SystemMessage(String.Format("Unrecognised Value: {0}", Header)); //Unrecognised Value. break; } } if (!found) { switch (Key) { #region Switches case Strings.Name: Output.Add(Strings.Name + "\t\t" + Name); found = true; break; case Strings.DisplayedName: Output.Add(Strings.DisplayedName + "\t\t" + DisplayedName.ToString()); found = true; break; case Strings.LastIP: Output.Add(Strings.LastIP + "\t\t\t" + LastIP.ToString()); found = true; break; case Strings.LoginCount: Output.Add(Strings.LoginCount + "\t\t" + LoginCount.ToString()); found = true; break; case Strings.MessagesTyped: Output.Add(Strings.MessagesTyped + "\t\t" + MessagesTyped.ToString()); found = true; break; case Strings.DateJoined: Output.Add(Strings.DateJoined + "\t\t" + DateJoined.ToString()); found = true; break; case Strings.DateLastVisited: Output.Add(Strings.DateLastVisited + "\t\t" + DateLastVisited.ToString()); found = true; break; case Strings.PlayTime: Output.Add(Strings.PlayTime + "\t\t" + PlayTime.ToString()); found = true; break; case Strings.Kills: Output.Add(Strings.Kills + "\t\t\t" + Kills.ToString()); found = true; break; case Strings.Deaths: Output.Add(Strings.Deaths + "\t\t\t" + Deaths.ToString()); found = true; break; case Strings.FlightsFlown: Output.Add(Strings.FlightsFlown + "\t\t" + FlightsFlown.ToString()); found = true; break; case Strings.FlightHours: Output.Add(Strings.FlightHours + "\t\t" + FlightHours.ToString()); found = true; break; case Strings.Banned: Output.Add(Strings.Banned + "\t\t\t" + Banned.ToString()); found = true; break; case Strings.BannedBy: Output.Add(Strings.BannedBy + "\t\t" + BannedBy.ToString()); found = true; break; case Strings.DateBanned: Output.Add(Strings.DateBanned + "\t\t" + DateBanned.ToString()); found = true; break; case Strings.BanExpires: Output.Add(Strings.BanExpires + "\t\t" + BanExpires.ToString()); found = true; break; case Strings.BanReason: Output.Add(Strings.BanReason + "\t\t" + BanReason.ToString()); found = true; break; case Strings.TimesBanned: Output.Add(Strings.TimesBanned + "\t\t" + TimesBanned.ToString()); found = true; break; case Strings.Frozen: Output.Add(Strings.Frozen + "\t\t\t" + Frozen.ToString()); found = true; break; case Strings.FrozenBy: Output.Add(Strings.FrozenBy + "\t\t" + FrozenBy.ToString()); found = true; break; case Strings.DateFrozen: Output.Add(Strings.DateFrozen + "\t\t" + DateFrozen.ToString()); found = true; break; case Strings.FreezeExpires: Output.Add(Strings.FreezeExpires + "\t\t" + FreezeExpires.ToString()); found = true; break; case Strings.FreezeReason: Output.Add(Strings.FreezeReason + "\t\t" + FreezeReason.ToString()); found = true; break; case Strings.TimesFrozen: Output.Add(Strings.TimesFrozen + "\t\t" + TimesFrozen.ToString()); found = true; break; case Strings.Muted: Output.Add(Strings.Muted + "\t\t\t" + Muted.ToString()); found = true; break; case Strings.MutedBy: Output.Add(Strings.MutedBy + "\t\t\t" + MutedBy.ToString()); found = true; break; case Strings.DateMuted: Output.Add(Strings.DateMuted + "\t\t" + DateMuted.ToString()); found = true; break; case Strings.MuteExpires: Output.Add(Strings.MuteExpires + "\t\t" + MuteExpires.ToString()); found = true; break; case Strings.MuteReason: Output.Add(Strings.MuteReason + "\t\t" + MuteReason.ToString()); found = true; break; case Strings.TimesMuted: Output.Add(Strings.TimesMuted + "\t\t" + TimesMuted.ToString()); found = true; break; case Strings.Kicked: Output.Add(Strings.Kicked + "\t\t\t" + Kicked.ToString()); found = true; break; case Strings.KickedBy: Output.Add(Strings.KickedBy + "\t\t" + KickedBy.ToString()); found = true; break; case Strings.DateKicked: Output.Add(Strings.DateKicked + "\t\t" + DateKicked.ToString()); found = true; break; case Strings.KickReason: Output.Add(Strings.KickReason + "\t\t" + KickReason.ToString()); found = true; break; case Strings.TimesKicked: Output.Add(Strings.TimesKicked + "\t\t" + TimesKicked.ToString()); found = true; break; case Strings.OthersBanned: Output.Add(Strings.OthersBanned + "\t\t" + OthersBanned.ToString()); found = true; break; case Strings.OthersFrozen: Output.Add(Strings.OthersFrozen + "\t\t" + OthersFrozen.ToString()); found = true; break; case Strings.OthersMuted: Output.Add(Strings.OthersMuted + "\t\t" + OthersMuted.ToString()); found = true; break; case Strings.OthersKicked: Output.Add(Strings.OthersKicked + "\t\t" + OthersKicked.ToString()); found = true; break; case Strings.GroupRepresented: Output.Add(Strings.GroupRepresented + "\t" + GroupRepresented.ToString()); found = true; break; #endregion default: Logger.Log.SystemMessage(String.Format("Unrecognised Value: {0}", Key)); //Unrecognised Value. break; } } try { File.WriteAllLines(OutputFile, Output.ToList()); } catch { } }
//Methode um "hineingehen" in Level zu simulieren und Level zu starten private void StartLevel() { pbCharacterBounds.Location = new Point(-100, GameState.GroundLevel); pbCharacterBounds.Image = Properties.Resources.characterRight; pbCharacterBounds.Visible = true; System.Windows.Forms.Timer start = new System.Windows.Forms.Timer(); start.Enabled = true; start.Interval = 20; start.Tick += new EventHandler(MoveFirstSteps); GameState.Score = 0; void MoveFirstSteps(object sender, EventArgs e) { if (pbCharacterBounds.Location.X < 100) { pbCharacterBounds.Left += 3; } else { start.Enabled = false; if (GameState.PlayerHealth == 3) { pbHealth.Visible = true; pbHealth1.Visible = true; pbHealth2.Visible = true; } else if (GameState.PlayerHealth == 2) { pbHealth.Visible = false; pbHealth1.Visible = true; pbHealth2.Visible = true; } else if (GameState.PlayerHealth == 1) { pbHealth.Visible = false; pbHealth1.Visible = false; pbHealth2.Visible = true; } //pbHealth.Visible = true; //pbHealth1.Visible = true; //fpbHealth2.Visible = true; lblLevelDisplay.Visible = true; virusTimer.Enabled = true; gameTimer.Enabled = true; if (lblLevelDisplay.Text.Equals("Level 1")) { PlayTime.Start(); } if (lblLevelDisplay.Text.Equals("Level 3")) { Virus.StartBossLevel(); } GameTimer = DateTime.Now; PointObjectTimer = GameTimer.AddSeconds(10); MutatedVirusSpawnTimer = GameTimer.AddSeconds(25); this.KeyDown += new KeyEventHandler(new KeyDownEventHandler().Game_KeyDown); this.KeyUp += new KeyEventHandler(new KeyUpEventHandler().Game_KeyUp); } } }
// Use this for initialization void Start() { //HP=GameObject.Find("HP").GetComponent<Slider>(); HP.maxValue = goalUnit; playTime = GetComponent <PlayTime>(); }
public static void Initialize(GameShelfContext context) { context.Database.EnsureCreated(); if (context.Games.Any()) { return; } var playTimes = new PlayTime[] { new PlayTime { PlayTimeCategory = "Less Than an Hour" }, new PlayTime { PlayTimeCategory = "About an Hour" }, new PlayTime { PlayTimeCategory = "About 2 Hours" }, new PlayTime { PlayTimeCategory = "More Than 2 Hours" } }; foreach (PlayTime pt in playTimes) { context.Playtimes.Add(pt); } context.SaveChanges(); var games = new Game[] { new Game { Title = "Smallworld", MinPlayers = 2, MaxPlayers = 5, PlayTimeID = 1 }, new Game { Title = "Scotland Yard", MinPlayers = 3, MaxPlayers = 6, PlayTimeID = 2 }, new Game { Title = "Robbits", MinPlayers = 4, MaxPlayers = 4, PlayTimeID = 1 }, new Game { Title = "Dungeon Petz", MinPlayers = 2, MaxPlayers = 4, PlayTimeID = 3 }, new Game { Title = "Champions of Midgard", MinPlayers = 2, MaxPlayers = 4, PlayTimeID = 2 }, new Game { Title = "King of Tokyo", MinPlayers = 2, MaxPlayers = 6, PlayTimeID = 1 }, new Game { Title = "Scythe", MinPlayers = 1, MaxPlayers = 5, PlayTimeID = 2 } }; foreach (Game g in games) { context.Games.Add(g); } context.SaveChanges(); var people = new Person[] { new Person { FirstName = "Katherine", LastName = "Conrad" }, new Person { FirstName = "Tom", LastName = "Conrad" }, new Person { FirstName = "Cindy", LastName = "Conrad" }, new Person { FirstName = "Jamison", LastName = "Muller" }, new Person { FirstName = "Matt", LastName = "Conrad" }, new Person { FirstName = "Philippe", LastName = "Keyaerts" }, new Person { FirstName = "Manfred", LastName = "Burggraf" }, new Person { FirstName = "Dorothy", LastName = "Garrels" }, new Person { FirstName = "Vlaada", LastName = "Chvàtil" }, new Person { FirstName = "Ole", LastName = "Steiness" }, new Person { FirstName = "Richard", LastName = "Garfield" }, new Person { FirstName = "Jamey", LastName = "Stegmaier" } }; foreach (Person p in people) { context.People.Add(p); } context.SaveChanges(); var gamePersonRelationships = new GamePersonRelationship[] { new GamePersonRelationship { GameID = 1, PersonID = 5, Role = Role.Owner }, new GamePersonRelationship { GameID = 1, PersonID = 6, Role = Role.Designer }, new GamePersonRelationship { GameID = 2, PersonID = 4, Role = Role.Owner }, new GamePersonRelationship { GameID = 2, PersonID = 7, Role = Role.Designer }, new GamePersonRelationship { GameID = 2, PersonID = 8, Role = Role.Designer }, new GamePersonRelationship { GameID = 3, PersonID = 1, Role = Role.Owner }, new GamePersonRelationship { GameID = 3, PersonID = 2, Role = Role.Owner }, new GamePersonRelationship { GameID = 3, PersonID = 1, Role = Role.Designer }, new GamePersonRelationship { GameID = 3, PersonID = 2, Role = Role.Designer }, new GamePersonRelationship { GameID = 4, PersonID = 1, Role = Role.Owner }, new GamePersonRelationship { GameID = 4, PersonID = 9, Role = Role.Designer }, new GamePersonRelationship { GameID = 5, PersonID = 2, Role = Role.Owner }, new GamePersonRelationship { GameID = 5, PersonID = 10, Role = Role.Designer }, new GamePersonRelationship { GameID = 6, PersonID = 3, Role = Role.Owner }, new GamePersonRelationship { GameID = 6, PersonID = 11, Role = Role.Designer }, new GamePersonRelationship { GameID = 7, PersonID = 5, Role = Role.Owner }, new GamePersonRelationship { GameID = 7, PersonID = 12, Role = Role.Designer } }; foreach (GamePersonRelationship gpr in gamePersonRelationships) { context.Relationships.Add(gpr); } context.SaveChanges(); }
//TEMP: public override string ToString() { return(string.Format("Name: {0}; Level: {1}; Experience: {2}; PlayTime: {3}", Name, Level.ToString(), Experience.ToString(), PlayTime.ToString())); }
// Use this for initialization void Start() { playTime = GetComponent <PlayTime>(); }
protected bool Equals(ScoreboardSummaryEntry other) { return(TeamId == other.TeamId && string.Equals(Location, other.Location) && string.Equals(Category, other.Category) && Division == other.Division && Tier == other.Tier && ImageCount == other.ImageCount && PlayTime.Equals(other.PlayTime) && TotalScore == other.TotalScore && Warnings == other.Warnings && Advancement == other.Advancement); }
public bool Search(string str) { if (ActionName.Contains(str) || LoopCount.ToString().Contains(str) || Interval.ToString().Contains(str) || PlayTime.ToString().Contains(str)) { return(true); } else { return(false); } }
protected override void Update(GameTime gameTime) { try { // TODO Remove temp code if (Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } if (currentScreen != null) { if (screenState == 0 && currentScreen.GetType() != typeof(SplashScreen)) { ChangeScreens(getCurrentScreen(), splashScreen); } else if (screenState == 1 && currentScreen.GetType() != typeof(GameMenu)) { ChangeScreens(getCurrentScreen(), gameMenu); } else if (screenState == 2 && currentScreen.GetType() != typeof(PlayScreen)) { ChangeScreens(getCurrentScreen(), playScreen); } } foreach (var item in gameThread.ToArray()) { if (item.IsCompleted) { ScreenManager.gameThread.Remove(item); } } #region mouseinput MouseInput.LastMouseState = MouseInput.MouseState; // Get the mouse state relevant for this frame MouseInput.MouseState = Mouse.GetState(); #endregion #region keyboardInput //keyboard inputs KeyBoardInput.handleOverallInput(); #endregion PlayTime.UpdatePlayTime(); #region framerate elapsedTime += gameTime.ElapsedGameTime; if (elapsedTime > TimeSpan.FromSeconds(1)) { elapsedTime -= TimeSpan.FromSeconds(1); frameRate = frameCounter; frameCounter = 0; } #endregion var startIndex = ScreenList.Count - 1; while (ScreenList[startIndex].IsPopup && ScreenList[startIndex].IsActive) { startIndex--; } for (var i = startIndex; i < ScreenList.Count; i++) { ScreenList[i].Update(gameTime); } } catch (Exception ex) { // ErrorLog.AddError(ex); throw ex; } finally { base.Update(gameTime); } }