public void Read(BinaryReader reader) { this.tagClass = reader.ReadGroupTag(); this.tagDatum = reader.ReadDatumIndex(); this.tagAddress = reader.ReadUInt32(); this.tagSize = reader.ReadInt32(); }
public PartialViewResult SendTag(GroupTagModel model) { var tag = db.GroupTags.SingleOrDefault(t => t.Tag.Equals(model.Tag)); var tagginggroup = db.TaggingGroups.Find(model.GroupId); if (tag == null) { tag = new GroupTag() { Tag = model.Tag, }; db.GroupTags.Add(tag); } if (!tagginggroup.GroupTags.Contains(tag)) { tagginggroup.GroupTags.Add(tag); //tag.Groups.Add(tagginggroup); } db.SaveChanges(); // Das Modell für die Anzeige der Liste aktualisieren return(PartialView("_GroupTagList", tagginggroup)); }
//public void OnReciveUndoCommand(ICommand command){} /// <summary> /// 构造函数 /// </summary> /// <param name="maxHp">最大Hp</param> /// <param name="attack">攻击力</param> /// <param name="defend">防御力</param> /// <param name="name">名字</param> /// <param name="groupTag">阵营</param> /// <param name="normalSkill">普通攻击</param> /// <param name="strongSkill">强力攻击</param> /// <param name="specialSkill">特殊攻击</param> protected BattleObjects(int maxHp, int attack, int defend, string name, GroupTag groupTag, SkillsAttribute normalSkill = null, SkillsAttribute strongSkill = null, SkillsAttribute specialSkill = null) : base(maxHp, attack, defend, name) { NormalAttack = normalSkill; StrongAttack = strongSkill; SpecialAttack = specialSkill; Group = groupTag; }
public static GroupTag ReadGroupTag(this BinaryReader reader) { // Read a GroupTag object from the stream. GroupTag tag = new GroupTag(); tag.value = reader.ReadChars(GroupTag.kSizeOf); return(tag); }
private ListViewGroup getGroup(GroupTag groupTag) { foreach (ListViewGroup lvg in listViewProp.Groups) { if ((GroupTag)lvg.Tag == groupTag) { return(lvg); } } return(null); }
//--------------------------------------------------------------------------------------------------------------------- void onGUIAddNode() { GUILayout.BeginVertical(Helper.oddBkg); GUILayout.Label("Add Node", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); //add node buttons for (int i = 0; i < System.Enum.GetValues(typeof(NodeType)).Length; i++) { if (GUILayout.Button(((NodeType)i).ToString(), GUILayout.Height(24))) { var newNode = activeBlock.AddNode(i, 0, lastPos, _selectedGroup, _selectedGroupTag); while (true) { var overlap = activeBlock.FirstOverlappedNode(newNode); if (overlap != null) { newNode.transform.position += Vector3.right; } else { break; } } lastPos = newNode.transform.position; var list = Selection.instanceIDs.ToList(); list.Add(newNode.gameObject.GetInstanceID()); Selection.instanceIDs = list.ToArray(); } } EditorGUILayout.EndHorizontal(); GUILayout.Space(5); EditorGUILayout.BeginHorizontal(Helper.evenBkg); //start lastPos = EditorGUILayout.Vector2Field("start next node at:", lastPos, GUILayout.Width(120)); lastPos = new Vector2(Mathf.Round(lastPos.x * 2) / 2, Mathf.Round(lastPos.y * 4) / 4); if (GUILayout.Button("reset\nstart", GUILayout.Width(40), GUILayout.Height(30))) { lastPos = new Vector2(0, 8); } GUILayout.Space(15); //group GUILayout.BeginVertical(GUILayout.Width(250)); _selectedGroupTag = (GroupTag)EditorGUILayout.EnumPopup("Current Tag:", _selectedGroupTag); _selectedGroup = (Group)EditorGUILayout.EnumPopup("Current Group:", _selectedGroup); GUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); GUILayout.EndVertical(); }
public ActionResult Bind(List <TagViewModel> tobeadded, int groupId) { foreach (var tag in tobeadded) { var groupTag = new GroupTag() { GroupId = groupId, TagId = tag.ID, }; db.GroupTags.Add(groupTag); } db.SaveChanges(); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); }
private void OnTriggerEnter(Collider other) { if (other.tag == "TypeTwo") { FlockWithGroup script = other.GetComponent <FlockWithGroup>(); GroupTag otherTag = other.GetComponent <GroupTag>(); if (script.mCurrentBuddies.Contains(otherTag)) { script.mCurrentBuddies.Remove(otherTag); } Destroy(other.gameObject); Destroy(gameObject); } }
private void HideAttribute(GroupTag grpTag) { foreach (ListViewGroup grp in listViewProp.Groups) { if ((GroupTag)grp.Tag == grpTag) { while (grp.Items.Count > 0) { listViewProp.Items.Remove(grp.Items[0]); } listViewProp.Groups.Remove(grp); break; } } }
void onGUIChangeAll() { EditorGUILayout.BeginVertical(Helper.oddBkg); //altogether //groups GUILayout.Label("Change All", EditorStyles.boldLabel); allGroupTag = (GroupTag)EditorGUILayout.EnumPopup(allGroupTag, GUILayout.Width(60)); if (allGroupTag != GroupTag.Fixed) { allGroup = (Group)EditorGUILayout.EnumPopup(allGroup, GUILayout.Width(60)); } if (GUILayout.Button("Apply")) { foreach (var node in selectedNodes) { node.GroupTag = allGroupTag; node.Group = allGroup; } } EditorGUILayout.EndVertical(); }
//--------------------------------------------------------------------------------------------------------------------- void onGUIGizmoFilter() { //gizmo filter GUI.backgroundColor = Color.gray; GUILayout.BeginVertical(Helper.evenBkg, GUILayout.MinWidth(200)); GUILayout.Label("Filter Scene Objects", EditorStyles.boldLabel); _isGizmoGroupTagFilter = EditorGUILayout.BeginToggleGroup("Filter Tags", _isGizmoGroupTagFilter); _gizmoGroupTagFilterBy = (GroupTag)EditorGUILayout.EnumPopup(_gizmoGroupTagFilterBy); EditorGUILayout.EndToggleGroup(); _isGizmoGroupFilter = EditorGUILayout.BeginToggleGroup("Filter Groups", _isGizmoGroupFilter); _gizmoGroupFilterBy = (Group)EditorGUILayout.EnumPopup(_gizmoGroupFilterBy); EditorGUILayout.EndToggleGroup(); GUILayout.EndVertical(); //update can draw on all nodes UpdateCanDrawAllNodes(); }
public Node AddNode(int kind, int variation, Vector3 pos, Group group, GroupTag gtag) { //reset block transform transform.position = Vector3.zero; transform.rotation = Quaternion.identity; transform.localScale = Vector3.one; var newNode = new GameObject().AddComponent <Node>(); newNode.Data = new NodeData(); newNode.gameObject.tag = "dyn"; newNode.transform.parent = transform; newNode.transform.position = pos; newNode.Block = this; newNode.Group = group; newNode.GroupTag = gtag; newNode.Kind = (NodeType)kind; newNode.Variation = variation; newNode.ResetName(); return(newNode); }
public Group stringToTag(string s, Group g) { string[] toArray = s.Split('#'); List <GroupTag> gt = new List <GroupTag>(); for (int i = 0; i < toArray.Length; i++) { if (!String.IsNullOrEmpty(toArray[i].Trim())) { Tag t = new Tag { TagName = toArray[i].Trim() }; GroupTag gtt = new GroupTag { Tag = t, Group = g }; gt.Add(gtt); } } g.GroupTags = gt; return(g); }
//--------------------------------------------------------------------------------------------------------------------- void onGUISelectedNodes() { //title GUILayout.BeginHorizontal(); GUILayout.Label("Selection", EditorStyles.boldLabel); GUILayout.FlexibleSpace(); //filter by group GUILayout.BeginHorizontal(Helper.evenBkg); _isGroupTagFilter = EditorGUILayout.BeginToggleGroup("Filter By GroupTag", _isGroupTagFilter); GUILayout.BeginHorizontal(); _groupTagFilterBy = (GroupTag)EditorGUILayout.EnumPopup(_groupTagFilterBy); if (GUILayout.Button("Select All")) { Selection.instanceIDs = activeBlock.Nodes.Where(x => x.GroupTag == _groupTagFilterBy).Select(x => x.gameObject.GetInstanceID()).ToArray(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndToggleGroup(); EditorGUILayout.EndHorizontal(); //sort _sortMethod = (NodeSortMethod)EditorGUILayout.EnumPopup("Sort Method", _sortMethod, GUILayout.Width(200)); GUILayout.EndHorizontal(); bool even = false; if (Event.current.type == EventType.Layout) { //list selected nodes selectedNodes = Selection.gameObjects.Select(x => x.GetComponent <Node>()).Where(x => x != null).ToList(); if (selectedNodes.Any()) { //filter by block Selection.instanceIDs = selectedNodes.Where(x => x.Block == activeBlock).Select(x => x.gameObject.GetInstanceID()).ToArray(); //filter by group if (_isGroupTagFilter) { selectedNodes = selectedNodes.Where(x => x.GroupTag == _groupTagFilterBy).ToList(); } //sort by x,y switch (_sortMethod) { case NodeSortMethod.Type_X_Y: selectedNodes.Sort(new TXYComparer()); break; case NodeSortMethod.Type_Variation: selectedNodes.Sort(new TVComparer()); break; case NodeSortMethod.X_Y: selectedNodes.Sort(new XYComparer()); break; default: break; } } else { //no nodes selected if (Selection.gameObjects.Length == 1) { var blk = Selection.gameObjects.First().GetComponent <Block>(); if (blk != null) { activeBlock = blk; } } } } //backup padding var backupPadding = GUI.skin.button.padding; GUI.skin.button.padding = new RectOffset(0, 0, 0, 0); //header GUILayout.BeginHorizontal(Helper.hdrBkg); GUILayout.Space(48); GUILayout.Label("tag group x y type variation qty dist ss sx sy probability"); GUILayout.EndHorizontal(); //selection nodes _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition); foreach (var node in selectedNodes) { if (node.tag == "dyn") { //line colors if (node.IsFocused) { GUI.contentColor = Color.cyan; } GUILayout.BeginHorizontal(even ? Helper.evenBkg : Helper.oddBkg); even = !even; //buttons //o if (GUILayout.Button("o", Helper.wh16)) { //select Selection.instanceIDs = new int[] { node.gameObject.GetInstanceID() }; break; } //- if (GUILayout.Button("-", Helper.wh16)) { //remove from selection var list = Selection.instanceIDs.ToList(); list.Remove(node.gameObject.GetInstanceID()); Selection.instanceIDs = list.ToArray(); } //groups node.GroupTag = (GroupTag)EditorGUILayout.EnumPopup(node.GroupTag, GUILayout.Width(60)); if (node.GroupTag == GroupTag.Fixed) { GUILayout.Space(62); } else { node.Group = (Group)EditorGUILayout.EnumPopup(node.Group, GUILayout.Width(60)); } //x,y var pos = node.transform.position; pos.x = EditorGUILayout.FloatField(node.transform.position.x, Helper.w40h16); if (node.Kind == NodeType.GroundEnemy) { GUILayout.Space(44); } else { pos.y = EditorGUILayout.FloatField(node.transform.position.y, Helper.w40h16); } node.transform.position = pos; //kind,variation node.Kind = (NodeType)EditorGUILayout.EnumPopup(node.Kind, GUILayout.Width(80)); switch (node.Kind) { case NodeType.Collectible: node.Variation = (int)(CollectibleVariation)EditorGUILayout.EnumPopup((CollectibleVariation)node.Variation, GUILayout.Width(60)); break; case NodeType.Food: node.Variation = (int)(FoodVariation)EditorGUILayout.EnumPopup((FoodVariation)node.Variation, GUILayout.Width(60)); break; case NodeType.GroundEnemy: node.Variation = (int)(GroundVariation)EditorGUILayout.EnumPopup((GroundVariation)node.Variation, GUILayout.Width(60)); break; case NodeType.AirEnemy: node.Variation = (int)(AirGroupVariation)EditorGUILayout.EnumPopup((AirGroupVariation)node.Variation, GUILayout.Width(60)); break; case NodeType.Coin: default: GUILayout.Space(64); break; } //qty, dist, main if (node.Kind == NodeType.Coin) { node.Quantity = EditorGUILayout.IntField(node.Quantity, GUILayout.Width(30)); node.Distance = EditorGUILayout.FloatField(node.Distance, GUILayout.Width(30)); node.SS = EditorGUILayout.FloatField(node.SS / 1.57f, GUILayout.Width(30)) * 1.57f; node.SX = EditorGUILayout.FloatField(node.SX * 10, GUILayout.Width(30)) / 10; node.SY = EditorGUILayout.FloatField(node.SY, GUILayout.Width(30)); node.Probability = Mathf.Round(EditorGUILayout.Slider(node.Probability, 0f, 1f) * 10) / 10f; } else if (node.Kind == NodeType.GroundEnemy) { //main person node.IsMainTarget = GUILayout.Toggle(node.IsMainTarget, "Main", GUILayout.Width(166)); node.Probability = Mathf.Round(EditorGUILayout.Slider(node.Probability, 0f, 1f) * 10) / 10f; } else if (node.Kind == NodeType.Collectible) { GUILayout.Space(170); GUILayout.FlexibleSpace(); if (node.Probabilities == null) { node.Probabilities = new float[5]; } for (int i = 0; i < 5; i++) { node.Probabilities[i] = EditorGUILayout.FloatField(node.Probabilities[i], GUILayout.Width(30)); } } else { GUILayout.Space(170); node.Probability = Mathf.Round(EditorGUILayout.Slider(node.Probability, 0f, 1f) * 10) / 10f; } //u,d,l,r if (node.Kind == NodeType.GroundEnemy) { GUILayout.Space(50); } else { //up,down GUILayout.Space(10); if (GUILayout.Button(Helper.u, Helper.wh16)) { selectedNodes.ForEach(x => x.IsFocused = false); node.IsFocused = true; node.transform.position += new Vector3(0, .5f, 0); } if (GUILayout.Button(Helper.d, Helper.wh16)) { selectedNodes.ForEach(x => x.IsFocused = false); node.IsFocused = true; node.transform.position -= new Vector3(0, .5f, 0); } } //left, right if (GUILayout.Button(Helper.l, Helper.wh16)) { selectedNodes.ForEach(x => x.IsFocused = false); node.IsFocused = true; node.transform.position -= new Vector3(.5f, 0, 0); } if (GUILayout.Button(Helper.r, Helper.wh16)) { selectedNodes.ForEach(x => x.IsFocused = false); node.IsFocused = true; node.transform.position += new Vector3(.5f, 0, 0); } if (GUILayout.Button("X", Helper.wh16)) { var list = Selection.instanceIDs.ToList(); list.Remove(node.gameObject.GetInstanceID()); Selection.instanceIDs = list.ToArray(); DestroyImmediate(node.gameObject); } GUILayout.EndHorizontal(); //node.IsHover = Event.current.type == EventType.Repaint && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition); GUI.contentColor = Color.white; } } EditorGUILayout.EndScrollView(); //lower part EditorGUILayout.BeginHorizontal(); //statistics foreach (var group in selectedNodes.GroupBy(x => x.Kind)) { string s = ""; if (group.Key == NodeType.Coin) { s = string.Format("{1} {0}", group.Key, group.Sum(x => x.Quantity)); } else { s = string.Format("{1} {0}", group.Key, group.Count()); } GUILayout.Label(s); } //selection buttons if (GUILayout.Button("Select All", Helper.h30)) { Selection.instanceIDs = activeBlock.GetComponentsInChildren <Node>().Select(x => x.gameObject.GetInstanceID()).ToArray(); } if (GUILayout.Button("Deselect All", Helper.h30)) { Selection.instanceIDs = new int[] { }; } if (GUILayout.Button("Delete Selected", Helper.h30)) { if (EditorUtility.DisplayDialog("Delete", "Are you sure?", "Delete", "Cancel")) { Selection.gameObjects.ToList().ForEach(x => DestroyImmediate(x)); Selection.instanceIDs = new int[] { }; } } EditorGUILayout.EndHorizontal(); GUI.skin.button.padding = backupPadding; }
//====================================================================== // MonoBehaviour methods //====================================================================== void OnDisable() { m_hitGroup = GroupTag.NONE; }
public void Init() { instance = new GroupTag(); }
public string GroupShortText() { return(GroupTag == GroupTag.Fixed ? "" : string.Format("[{0}-{1}]", GroupTag.ToString()[1], Group.ToString()[1])); }
public void Read(BinaryReader reader) { this.childClass = reader.ReadGroupTag(); this.parentClass = reader.ReadGroupTag(); this.grandparentClass = reader.ReadGroupTag(); }
public static void Write(this BinaryWriter writer, GroupTag tag) { // Write a GroupTag object to the stream. writer.Write(tag.value); }
public static void Initialize(Looking4GroupContext context) { context.Database.EnsureCreated(); if (context.Questions.Any()) { return; //DB already seeded } //Q1 var q = new Question { DefaultQuestion = true, Title = "What is your preffered genre?", Answer1 = "MOBA ie. DotA, League of Lengends, Smite", Answer2 = "RTS ie. Starcraft, Age of Empires, etc.", Answer3 = "FPS ie. Counter Strike, Overwatch, Battlefront", Answer4 = "Other" }; context.Questions.Add(q); context.SaveChanges(); var qt = new QuestionTag { Label = "MOBA", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "FPS", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "RTS", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); //Q2 q = new Question { DefaultQuestion = true, Title = "How do you feel about multiplayer?", Answer1 = "Competitive!!", Answer2 = "Casual", Answer3 = "I like Co-Op", Answer4 = "What's multiplayer?" }; context.Questions.Add(q); context.SaveChanges(); qt = new QuestionTag { Label = "Competitve", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "Casual", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "Co-Op", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "Solo", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); //Q3 q = new Question { DefaultQuestion = true, Title = "What type of group if any are you looking for?", Answer1 = "Large Guild", Answer2 = "Small Guild/Group", Answer3 = "Small group of friends", Answer4 = "Just looking for someone to play games with." }; context.Questions.Add(q); context.SaveChanges(); qt = new QuestionTag { Label = "LargeGuild", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "SmallGuild", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "Friends", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "Partner", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); //Q4 q = new Question { DefaultQuestion = true, Title = "Which of these games appeals the most to you?", Answer1 = "Rocket League", Answer2 = "Kerbal Space Program", Answer3 = "World of Warcraft", Answer4 = "Ovewrwatch" }; context.Questions.Add(q); context.SaveChanges(); qt = new QuestionTag { Label = "Sports", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "Sandbox", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "MMO", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); qt = new QuestionTag { Label = "FPS", Question = q }; context.QuestionTags.Add(qt); q.Tags.Add(qt); context.Questions.Update(q); context.SaveChanges(); //Add a test groups //Group 1 var g = new Group { Name = "UpAllNight", Link = "http://www.upallnight.com", Description = "Casual group of friends who like to play games. Come join us we play just about everything!" }; context.Groups.Add(g); context.SaveChanges(); var gt = new GroupTag { Label = "Casual", Weight = 25, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Friends", Weight = 50, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "FPS", Weight = 20, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Sandbox", Weight = 10, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); //Group 2 g = new Group { Name = "MLG", Link = "http://www.mlg.com", Description = "Highly competitive group. Think you got what it takes?" }; context.Groups.Add(g); context.SaveChanges(); gt = new GroupTag { Label = "Competitve", Weight = 100, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "SmallGuild", Weight = 50, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "FPS", Weight = 75, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "RTS", Weight = 30, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); //Group 3 g = new Group { Name = "Noob", Link = "http://www.noob.com", Description = "Clan noob is a friendly envirnment for people looking to get a jumpstart into Eve! We welcome everyone no matter your skill!" }; context.Groups.Add(g); context.SaveChanges(); gt = new GroupTag { Label = "Casual", Weight = 66, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "LargeGuild", Weight = 100, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "MMO", Weight = 100, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); //Group 4 g = new Group { Name = "42", Link = "http://www.42.com", Description = "The answer to everything, especially rocket league! Come join us for some awesome high speed action! Comp, Casual, doesn't matter!" }; context.Groups.Add(g); context.SaveChanges(); gt = new GroupTag { Label = "Casual", Weight = 35, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "LargeGuild", Weight = 100, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Sports", Weight = 80, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Competitive", Weight = 40, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); //Group 5 g = new Group { Name = "Match.Gamer", Link = "http://www.coop.com", Description = "Do you like co-op? Do you prefer to just play with a small group of 1 or 2 friends? This is the place for you! Join us and we'll match you up with someone to play with!" }; context.Groups.Add(g); context.SaveChanges(); gt = new GroupTag { Label = "Casual", Weight = 75, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Partner", Weight = 60, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Co-Op", Weight = 80, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); gt = new GroupTag { Label = "Friends", Weight = 40, Group = g }; context.GroupTags.Add(gt); g.Tags.Add(gt); context.Groups.Update(g); context.SaveChanges(); //Add test games //Game 1 var game = new Game { Name = "Counter-Strike: Global Offensive", Description = "Counter-Strike: Global Offensive (CS: GO) will expand upon the team-based action gameplay that it pioneered when it was launched 14 years ago. " + "CS: GO features new maps, characters, and weapons and delivers updated versions of the classic CS content(de_dust, etc.).In addition, CS: GO will introduce new gameplay modes, matchmaking, leader boards, and more.", Link = "http://store.steampowered.com/app/730/" }; context.Games.Add(game); context.SaveChanges(); var gameTag = new GameTag { Label = "Competitive", Weight = 70, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "FPS", Weight = 100, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Team-Based", Weight = 80, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); //Game 2 game = new Game { Name = "Overwatch", Description = "Overwatch is a team-based multiplayer first-person shooter video game developed and published by Blizzard Entertainment. It was released in May 2016 for Microsoft Windows, PlayStation 4, and Xbox One.", Link = "https://playoverwatch.com/en-us/" }; context.Games.Add(game); context.SaveChanges(); gameTag = new GameTag { Label = "Team-Based", Weight = 90, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "FPS", Weight = 100, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Casual", Weight = 40, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); //Game 3 game = new Game { Name = "Minecraft", Description = "Minecraft is a game about placing blocks and going on adventures", Link = "https://minecraft.net/en-us/" }; context.Games.Add(game); context.SaveChanges(); gameTag = new GameTag { Label = "Sandbox", Weight = 90, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Casual", Weight = 50, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Solo", Weight = 60, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Co-Op", Weight = 20, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); //Game 4 game = new Game { Name = "League of Legends", Description = "Minecraft is a game about placing blocks and going on adventures", Link = "https://minecraft.net/en-us/" }; context.Games.Add(game); context.SaveChanges(); gameTag = new GameTag { Label = "MOBA", Weight = 100, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Casual", Weight = 60, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Competitive", Weight = 50, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Co-Op", Weight = 5, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); //Game 5 game = new Game { Name = "Rocket League", Description = "Soccer meets driving once again in the long-awaited, physics-based multiplayer-focused sequel to Supersonic Acrobatic Rocket-Powered Battle-Cars! Choose a variety of high-flying vehicles equipped with huge rocket boosters to score amazing aerial goals and pull-off incredible game-changing saves!", Link = "http://store.steampowered.com/app/252950/" }; context.Games.Add(game); context.SaveChanges(); gameTag = new GameTag { Label = "Sports", Weight = 100, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Casual", Weight = 60, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Competitive", Weight = 60, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); //Game 6 game = new Game { Name = "EVE Online", Description = "Explore. Build. Conquer. A limitless universe awaits you! EVE is Free · Every Journey Is Unique · Every Decision Counts · EVE Is People · EVE Is Challenging In Terms Of Scale And Substance There's Nothing Like It", Link = "https://www.eveonline.com/" }; context.Games.Add(game); context.SaveChanges(); gameTag = new GameTag { Label = "MMO", Weight = 100, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Casual", Weight = 20, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); gameTag = new GameTag { Label = "Competitive", Weight = 30, Game = game }; context.GameTags.Add(gameTag); game.Tags.Add(gameTag); context.Games.Update(game); context.SaveChanges(); }