public Player(string name, int number, Teams team, Roles role) { _name = name.Replace(" ", ""); Number = number; Team = team; Role = role; }
public Player(String name, Teams team) { this._name = name; this._team = team; RegisterFigures(); }
public override void InitialiseSpecial(float height) { currentScale = new Vector3(1.0f, 1.0f, 0); transform.localPosition = new Vector3(0,0,0); RpcFindModels(); teams = GameObject.FindGameObjectWithTag("GameController").GetComponent<Teams>(); }
public HUDData(string name, Teams team) { this.name = name; this.team = team; isEmpty = false; }
private void ExecuteSwitchTeams() { _currentTeam = (_currentTeam == Teams.Home) ? Teams.Away : Teams.Home; foreach (var p in Points) p.Team = _currentTeam; }
public PointViewModel(string id, double x, double y, Teams team) { this.Id = id; this.X = x; this.Y = y; this.Team = team; }
public IStructure(float maxhp, StructureTypes type, Teams team, Rect rectangle) : base(maxhp) { Type = type; Team = team; Rectangle = rectangle; }
private void Clean() { this.Sysid = null; this.Teamsysid = null; this.Tag = string.Empty; this.Createdate = null; this.Active = null; this.Teams = null; }
public Message(string sender, string contents, Teams team) { Sender = sender; Contents = contents; Team = team; Timestamp = DateTime.UtcNow; Type = MessageType.Chat; }
public Message(string contents) { Sender = null; Contents = contents; Team = Teams.None; Timestamp = DateTime.UtcNow; Type = MessageType.System; }
public Message(string contents, MessageType type) { Sender = null; Contents = contents; Team = Teams.None; Timestamp = DateTime.UtcNow; Type = type; }
public TeamStructures(Teams team, Vec2 baseTileIds, Vec2 baseTowerTileIds, Vec2 topTowerTileIds, Vec2 bottomTowerTileIds) { Structures = Utilities.MakeList<IStructure>( Base = new Base(team, GetFeetPosForStructure(baseTileIds)), BaseTower = new Tower(StructureTypes.BaseTower, team, GetFeetPosForStructure(baseTowerTileIds)), TopTower = new Tower(StructureTypes.TopTower, team, GetFeetPosForStructure(topTowerTileIds)), BottomTower = new Tower(StructureTypes.BottomTower, team, GetFeetPosForStructure(bottomTowerTileIds))); }
private void Clean() { this.Sysid = null; this.Publicid = null; this._teamsysid = null; this.Keypath = string.Empty; this.Keyvalue = string.Empty; this.Active = null; this.Teams = null; }
private void Scenario6Reset(object sender, RoutedEventArgs e) { Teams teams = new Teams(); var result = from t in teams group t by t.City into g orderby g.Key select new { Key = g.Key, Items = g }; ; groupInfoCVS.Source = result; }
public ChampionSpawnInfo(ulong id, Vec2 spawn, ChampionTypes type, Teams team, float maxhp, float hp) : this() // to be able to have automatic properties (http://stackoverflow.com/a/420441/395386) { ID = id; SpawningPosition = spawn; Type = type; Team = team; MaxHealth = maxhp; Health = hp; }
public Base(Teams team, Vec2 feetPos) : base(HEALTH, StructureTypes.Base, team, new Rect( feetPos.X - WIDTH / 2f, feetPos.Y - HEIGHT, WIDTH, HEIGHT)) { Regen = new LifeRegenerator(this, null, RegenTick, HEALTH_REGEN); }
public ICharacter(ulong id, Vec2 position, ChampionTypes type, Teams team) : base(id, position, 100f, 26f, 40f)//TODO: stats by champion { JumpForce = 800; HorizontalAcceleration = 9e-9f; Animation = ChampionAnimation.idle; FacingLeft = team == Teams.Right; // face the opposite team Team = team; Type = type; }
public void AddPoint(Teams team) { if (team == Teams.Home) { this.VolleyballMatch.SetsOfTheMatch[this.CurrentSet - 1].HomePoints++; } if (team == Teams.Guest) { this.VolleyballMatch.SetsOfTheMatch[this.CurrentSet - 1].GuestPoints++; } }
public Tower(StructureTypes type, Teams team, Vec2 feetPos) : base(HEALTH, type, team, new Rect( feetPos.X - WIDTH / 2f, feetPos.Y - HEIGHT, WIDTH, HEIGHT)) { Debug.Assert(StructureHelper.IsTower(type)); TimeOfLastShot = 0f; Preparing = false; }
Action<Hero> selectedHeroChanging; //Hero is the new selected hero, bool is true if Hero is from the team which is currently playing void Start() { //THERE CAN BE ONLY ONE if (gameController != null && gameController != this) { Destroy (this.gameObject); return; } gameController = this; gameState = GameStates.StandBy; turn = Teams.Red; UIController.UI.Initialize (); }
// saves data out to a file // could check if file already exists, and then merge the new data with the old data to just // save that! Probably would be easier since i don't wana have to re save thousands of ints each // time, i'd rather just save ones that changed...? is that actually better! public void Save(Teams[] allExistingTeams) { // create a file and push data to it BinaryFormatter bf = new BinaryFormatter(); //playerInfo.dat is our file name! FileStream file = File.Create(Application.persistentDataPath + "/playerInfo.dat"); PlayerData data = new PlayerData(); // instantiate a new instance of our class we are going to save! // data.health = this.health; // data.experience = this.experience; data.myTeams = allExistingTeams; bf.Serialize(file, data); // take the serializable class data and save it to our file file.Close(); // Close the file now that we have saved the data to it! }
public LinearSpell(ulong id, Teams team, Vec2 position, Vec2 target, SpellTypes type, ICharacter owner) : base(id, position, SpellsHelper.Info(type).Speed, SpellsHelper.Info(type).Width, SpellsHelper.Info(type).Width) { Info = SpellsHelper.Info(type); IsSolid = Info.Solid; Type = type; Velocity = Vec2.Normalize(target - position) * MoveSpeed; StartPosition = (Vec2)position.Clone(); Team = team; Owner = owner; }
public void AddBot(Teams team, Roles role) { int botNumber = 0; string name = ""; while (name == "") { for (int i = 0; i < Config.BotNames.Count; i++) { string tryName = Config.BotNames[i] + " Bot" + (botNumber == 0 ? "" : botNumber.ToString()); bool found = false; foreach (KeyValuePair<int, Player> kvp in Players) { if (tryName == kvp.Value.Name) found = true; } if (!found) { name = tryName; break; } botNumber++; } } Bot bot = new Bot(name, Config.Random.Next(0, 50), team, role); AddPlayer(bot); }
public PrintModul(PrintType dataGridInfo, dynamic detail = null) { this.dataGridInfo = dataGridInfo; PrintType ch = dataGridInfo; // Entscheide was gedruckt werden soll switch (ch) { case PrintType.Team: this.CheckCSV(); Teams teams = new Teams(detail); break; case PrintType.Sponsor: this.CheckCSV(); Sponsor sponsor = new Sponsor(detail); break; case PrintType.Client: this.CheckCSV(); Client customer = new Client(detail); break; case PrintType.LopOffList: this.CheckCSV(); LopOffList lopOff = new LopOffList(); break; case PrintType.Statistic: KöTaf.Utils.Printer.CSVExporter csv = new Utils.Printer.CSVExporter(detail); var header = csv.GetHeader(); var content = csv.GetData(); var csvFull = csv.GetCsv(); csv.Write(); try { Libre_TeSpClConverter ooConv = new Libre_TeSpClConverter(PrintType.Statistic); } catch (Exception ex) { throw ex; } break; } }
private Position getValidSpawningPoint(Teams team) { Position[] array; Position ret = null; if (team == Teams.Blue) array = blueSpawningPoints.ToArray(); else if (team == Teams.Red) array = redSpawningPoints.ToArray(); else { Debug.LogError ("Trying to get spawning point for a weird team"); return null; } for (int i = 0; i < array.Length; i++) { ret = array [i]; if (MapController.mapController.isPositionEmpty (ret)) break; } return ret; }
public static void RegisterTeam(string name, Teams currentTeam) { if(teams.Count == 0) { // print("teamCount is 0"); teamCount = 1; } print("RegisterPlayer " + name + " teamCount " + teamCount); string _playerID = name; teams.Add(_playerID, teamCount); currentTeam.team = teamCount; if (teamCount == 1) { teamCount = 2; // print("newTeamCount = " + teamCount); } else if(teamCount == 2) { teamCount = 1; //print("newTeamCount = " + teamCount); } }
public void TestEqualsMethod() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); bool test = true; Performance myPerformance1 = new Performance("A", "AA", 1.1m); Performance myPerformance2 = new Performance("B", "BB", 2.2m); Performance myPerformance3 = new Performance("C", "CC", 3.3m); Performance myPerformance4 = new Performance("D", "AA", 4.1m); Performance myPerformance5 = new Performance("E", "BB", 5.2m); Performance myPerformance6 = new Performance("F", "CC", 6.3m); List <Performance> myPerformancesA = new List <Performance>(); myPerformancesA.Add(myPerformance1); myPerformancesA.Add(myPerformance2); List <Performance> myPerformancesB = new List <Performance>(); myPerformancesB.Add(myPerformance3); myPerformancesB.Add(myPerformance4); List <Performance> myPerformancesC = new List <Performance>(); myPerformancesC.Add(myPerformance5); myPerformancesC.Add(myPerformance6); Dictionary <string, List <Performance> > myEventsA = new Dictionary <string, List <Performance> >(); myEventsA.Add("Boy's 100", myPerformancesA); myEventsA.Add("Boy's 200", myPerformancesB); Dictionary <string, List <Performance> > myEventsB = new Dictionary <string, List <Performance> >(); myEventsB.Add("Boy's 100", myPerformancesA); myEventsB.Add("Boy's 200", myPerformancesB); Dictionary <string, List <Performance> > myEventsC = new Dictionary <string, List <Performance> >(); myEventsC.Add("Boy's 100", myPerformancesB); myEventsC.Add("Boy's 200", myPerformancesC); //Teams Dictionary <string, string> boysNamesA = new Dictionary <string, string>(); boysNamesA.Add("BLN", "Baldwin"); boysNamesA.Add("TJ", "Thomas Jefferson"); boysNamesA.Add("WHS", "Washington HS"); Dictionary <string, string> boysNamesB = new Dictionary <string, string>(); boysNamesB.Add("BLN", "Baldwin"); boysNamesB.Add("TJ", "Thomas Jefferson"); boysNamesB.Add("WHS", "Washington HS"); Dictionary <string, string> boysNamesC = new Dictionary <string, string>(); boysNamesC.Add("BLN", "Baldwin"); boysNamesC.Add("TJ", "Thomas Jefferson"); boysNamesC.Add("WHS", "Washington"); Dictionary <string, string> boysNamesD = new Dictionary <string, string>(); boysNamesD.Add("BLN", "Baldwin"); boysNamesD.Add("TJ", "Thomas Jefferson"); boysNamesD.Add("BHS", "Washington HS"); Dictionary <string, string> girlsNamesA = new Dictionary <string, string>(); girlsNamesA.Add("PLM", "Plum"); girlsNamesA.Add("GWY", "Gateway"); girlsNamesA.Add("KCH", "Knoch"); Dictionary <string, string> girlsNamesB = new Dictionary <string, string>(); girlsNamesB.Add("PLM", "Plum"); girlsNamesB.Add("GWY", "Gateway"); girlsNamesB.Add("KCH", "Knoch"); Dictionary <string, string> girlsNamesC = new Dictionary <string, string>(); girlsNamesC.Add("PLM", "Plum"); girlsNamesC.Add("GWY", "Gateway"); girlsNamesC.Add("KCH", "Ohio HS"); Dictionary <string, string> girlsNamesD = new Dictionary <string, string>(); girlsNamesD.Add("PLM", "Plum"); girlsNamesD.Add("GWY", "Gateway"); girlsNamesD.Add("KOH", "Knoch"); Teams teams1 = new Teams(boysNamesA, girlsNamesA); Teams teams2 = new Teams(boysNamesB, girlsNamesB); Teams teams3 = new Teams(boysNamesC, girlsNamesA); Teams teams4 = new Teams(boysNamesA, girlsNamesC); Teams teams5 = new Teams(boysNamesD, girlsNamesA); Teams teams6 = new Teams(boysNamesA, girlsNamesD); //Meet to test Meet meet1 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1, myEventsA); //Equal Meet Meet meet2 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams2, myEventsB); //Differnet Date Meet meet3 = new Meet(new DateTime(2017, 04, 12), "Baldwin HS", "Windy", teams1, myEventsA); //Different Location Meet meet4 = new Meet(new DateTime(2017, 04, 13), "Trinity HS", "Windy", teams1, myEventsA); //Different Weather Conditions Meet meet5 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Cloudy", teams1, myEventsA); //Different Boy's Teams Meet meet6 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams3, myEventsA); //Differnet Girls's Teams Meet meet7 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams4, myEventsA); //Different Boy's Abbr Meet meet8 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams5, myEventsA); //Different Girl's Abbr Meet meet9 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams6, myEventsA); //Different Results Meet meet10 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1, myEventsC); //No Results Meet meet11 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1); if (!meet1.Equals(meet2)) { test = false; Console.WriteLine("meet1 does not equal meet2"); } if (meet1.Equals(meet3)) { test = false; Console.WriteLine("meet1 equals meet3"); } if (meet1.Equals(meet4)) { test = false; Console.WriteLine("meet1 equals meet4"); } if (meet1.Equals(meet5)) { test = false; Console.WriteLine("meet1 equals meet5"); } if (meet1.Equals(meet6)) { test = false; Console.WriteLine("meet1 equals meet6"); } if (meet1.Equals(meet7)) { test = false; Console.WriteLine("meet1 equals meet7"); } if (meet1.Equals(meet8)) { test = false; Console.WriteLine("meet1 equals meet8"); } if (meet1.Equals(meet9)) { test = false; Console.WriteLine("meet1 equals meet9"); } if (meet1.Equals(meet10)) { test = false; Console.WriteLine("meet1 equals meet10"); } if (meet1.Equals(meet11)) { test = false; Console.WriteLine("meet1 equals meet11"); } Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); List <Teams> roster = new List <Teams>(); for (int i = 0; i < n; i++) { string[] teamsToRegister = Console.ReadLine().Split('-'); string teamLeader = teamsToRegister[0]; string teamName = teamsToRegister[1]; if (roster.Any(x => x.TeamName == teamName)) { Console.WriteLine($"Team {teamName} was already created!"); continue; } if (roster.Any(x => x.TeamLeader == teamLeader)) { Console.WriteLine($"{teamLeader} cannot create another team!"); continue; } Teams team = new Teams(teamLeader, teamName); roster.Add(team); Console.WriteLine($"Team {teamName} has been created by {teamLeader}!"); } string[] addingMembers = Console.ReadLine().Split("->"); while (addingMembers[0] != "end of assignment") { string teamMember = addingMembers[0]; string teamName = addingMembers[1]; if (!roster.Any(x => x.TeamName == teamName)) { Console.WriteLine($"Team {teamName} does not exist!"); addingMembers = Console.ReadLine().Split("->"); continue; } if (roster.Any(x => x.TeamMembers.Contains(teamMember)) || roster.Any(x => x.TeamLeader == teamMember && x.TeamName == teamName)) { Console.WriteLine($"Member {teamMember} cannot join team {teamName}!"); addingMembers = Console.ReadLine().Split("->"); continue; } int index = roster.FindIndex(x => x.TeamName == teamName); roster[index].TeamMembers.Add(teamMember); addingMembers = Console.ReadLine().Split("->"); } var disbanded = roster .FindAll(x => x.TeamMembers.Count == 0) .OrderBy(x => x.TeamName).ToList(); var validTeams = roster.FindAll(x => x.TeamMembers.Count > 0) .OrderBy(x => x.TeamName).ToList(); StringBuilder sb = new StringBuilder(); foreach (Teams item in validTeams.OrderByDescending(x => x.TeamMembers.Count)) { sb.AppendLine($"{item.TeamName}"); sb.AppendLine($"- {item.TeamLeader}"); foreach (var member in item.TeamMembers.OrderBy(x => x)) { sb.AppendLine($"-- {member}"); } } sb.AppendLine("Teams to disband:"); foreach (Teams item in disbanded) { sb.AppendLine(item.TeamName); } Console.WriteLine(sb.ToString()); }
public CRRB_WFA(Teams team) : base(team) { Type = PieceTypes.CRRBWFA; }
public RuntimeAnimatorController SetRuntimeAnimationController(Teams teamId, RuntimeAnimatorController runtimeAnimatorController) { return(GetCharacter(teamId).runtimeAnimatorController = runtimeAnimatorController); }
public GameState Move(GameState gameState, Teams team, int currentMove) { //STEP 1: CHOOSE (RANDOM) VALID PIECE TO MOVE List <Tile> possibleTiles = new List <Tile>(); for (int x = 0; x < gameState.Width; x++) { for (int y = 0; y < gameState.Height; y++) { if (gameState.Tiles[x, y].unit.team == team && gameState.Tiles[x, y].unit.energy > 0) { possibleTiles.Add(gameState.Tiles[x, y]); } } } int chosenPos = Random.Range(0, possibleTiles.Count); //Debug.Log(chosenPos + "," + (possibleTiles.Count)); Tile chosenTile = possibleTiles[chosenPos]; gameState.SetPossibleMoves(chosenTile.x, chosenTile.y, team, chosenTile.unit.energy); //STEP 2: MOVE A (RANDOM) VALID POSITION List <Tile> possibleMoves = new List <Tile>(); for (int x = 0; x < gameState.Width; x++) { for (int y = 0; y < gameState.Height; y++) { if (gameState.Tiles[x, y].possibleMove == team) { possibleMoves.Add(gameState.Tiles[x, y]); // Debug.Log("Possible x,y: " + x + ", " + y); } } } if (possibleMoves.Count == 0) { // Debug.Log("Blocked unit: " + team); gameState.ClearPossibleMoves(); if (chosenTile.unit.energy <= gameState.GetScore(team)) { // Debug.Log("Blocked Loss"); return(gameState); } else { Move(gameState, team, currentMove); // skip blocked units } } chosenPos = Random.Range(0, possibleMoves.Count); //Debug.Log(chosenPos + "," + (possibleMoves.Count)); Tile moveToTile = possibleMoves[chosenPos]; //Debug.Log("Chosen x,y: " + moveToTile.x + ", " + moveToTile.y); gameState.Move(moveToTile.x, moveToTile.y, true); //Debug.Log("Move gameState team: " + gameState.Tiles[moveToTile.x, moveToTile.y].unit.team); return(gameState); }
public ScoringEfficiency(Field field, Teams team, int turns) : this(field.GetScore(team) - field.GetScore(team.GetEnemyTeam()), turns) { }
public void UpdateTeams(string oldName, string oldTeam) { if (Team == oldTeam && Name == oldName) { return; } //Debug.Log("Call; oldName: '" + oldName + "' Name: '" + Name + "' oldTeam: '" + oldTeam + "' Team: " + Team); // Updates team and player data for the local Teams system. Teams t = Teams.I; if (Name != oldName) { if (string.IsNullOrEmpty(oldName)) { // We did not have an old name... // Check to see if we are on the system (we should not be!) and add the player if (!t.PlayerInSystem(Name)) { t.EnsureTeam(Team); t.AddPlayer(this, Team); Debug.Log("Added player to system. Name: " + Name + ", Team: " + Team); } } else { // We have an old name, lets change names! if (t.PlayerInSystem(oldName)) { t.ChangePlayerName(oldName, Name); Debug.Log("Changed player name from '" + oldName + "' to '" + Name + "'"); } else { t.EnsureTeam(Team); t.AddPlayer(this, Team); } } } if (Team != oldTeam) { if (string.IsNullOrEmpty(oldTeam)) { // Means that this must be first time commit, meaning that we have already been added to team! } else { // Old team is not null, lets swap teams! if (t.PlayerInSystem(Name)) { t.EnsureTeam(Team); t.ChangePlayerTeam(Name, Team); Debug.Log("Changed team of player '" + Name + "' from team '" + oldTeam + "' to '" + Team + "'"); } else { t.EnsureTeam(Team); t.AddPlayer(this, Team); Debug.Log("Added player WHILE changing team: '" + Name + "' from team '" + oldTeam + "' to '" + Team + "'"); } } } }
public CRRB_FD(Teams team) : base(team) { Type = PieceTypes.CRRBFD; }
public CRRB_Archbishop(Teams team) : base(team) { Type = PieceTypes.CRRBArchBishop; }
public void Apply(TeamRemoved e) { Teams.RemoveAll(x => x.Id.Equals(e.TeamId)); }
public Trainer(Teams team, string name) { Team = team; Name = name; }
public CRRB_Chancellor(Teams team) : base(team) { Type = PieceTypes.CRRBChancellor; }
public void AddToGame(Client client, Teams team) { LastAdded = team; exPlayer.Get(client).InSnowballGame = true; exPlayer.Get(client).SnowballGameSide = team; exPlayer.Get(client).SnowballGameInstance = this; exPlayer.Get(client).SnowballGameLives = PLAYERLIVES; if (team == Teams.Green) { GreenTeam.Add(client); } else if (team == Teams.Blue) { BlueTeam.Add(client); } PlayerCount++; if (client != GameLeader) { Messenger.PlayerMsg(client, "You have joined the game! Wait until the leader starts the game!", Text.Yellow); Messenger.PlayerMsg(GameLeader, client.Player.Name + " has been added to the game!", Text.Yellow); } }
public async Task <long> AddChild(string name, long parentId) { return(User.Identity.RootTeamsProxy != null ? await User.Identity.RootTeamsProxy.AddChildNode(parentId, Teams.Set(p => p.Name, name)) : await ClusterClient.Default.GetGrain <IUserGrain>(User.Identity.Name).PatchRootTeams(name)); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Devices = new Devices(this); Notifications = new Notifications(this); OrgInvitations = new OrgInvitations(this); DistributionGroupInvitations = new DistributionGroupInvitations(this); AppInvitations = new AppInvitations(this); Sharedconnection = new Sharedconnection(this); DataSubjectRight = new DataSubjectRight(this); Users = new Users(this); Releases = new Releases(this); //Builds = new Builds(this); CodePushAcquisition = new CodePushAcquisition(this); DistibutionReleases = new DistibutionReleases(this); DistributionGroups = new DistributionGroups(this); Teams = new Teams(this); AzureSubscription = new AzureSubscription(this); Organization = new Organization(this); Apps = new Apps(this); Organizations = new Organizations(this); Invitations = new Invitations(this); NpsSurvey = new NpsSurvey(this); HappinessSurvey = new HappinessSurvey(this); Webhooks = new Webhooks(this); Crashes = new Crashes(this); Test = new Test(this); Symbols = new Symbols(this); SymbolUploads = new SymbolUploads(this); MissingSymbolGroups = new MissingSymbolGroups(this); Repositories = new Repositories(this); RepositoryConfigurations = new RepositoryConfigurations(this); Provisioning = new Provisioning(this); ReleaseUploads = new ReleaseUploads(this); Push = new Push(this); FileAssets = new FileAssets(this); ExportConfigurations = new ExportConfigurations(this); Errors = new Errors(this); StoreReleases = new StoreReleases(this); Stores = new Stores(this); App = new App(this); CodePushDeploymentRelease = new CodePushDeploymentRelease(this); DeploymentReleases = new DeploymentReleases(this); CodePushDeploymentReleases = new CodePushDeploymentReleases(this); CodePushDeployments = new CodePushDeployments(this); CodePushDeploymentMetrics = new CodePushDeploymentMetrics(this); CrashGroups = new CrashGroups(this); Commits = new Commits(this); BugTracker = new BugTracker(this); BranchConfigurations = new BranchConfigurations(this); AppleMapping = new AppleMapping(this); Analytics = new Analytics(this); ApiTokens = new ApiTokens(this); BaseUri = new System.Uri("https://api.appcenter.ms"); SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <SharedConnectionRequest>("serviceType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <SharedConnectionRequest>("serviceType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <SharedConnectionResponse>("serviceType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <SharedConnectionResponse>("serviceType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <PrivateSharedConnectionResponse>("serviceType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <PrivateSharedConnectionResponse>("serviceType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Log>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Log>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <CustomProperty>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <CustomProperty>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <LogFlowLog>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <LogFlowLog>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <LogFlowCustomProperty>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <LogFlowCustomProperty>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <LogDiagnostics>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <LogDiagnostics>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <CustomPropertyDiagnostics>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <CustomPropertyDiagnostics>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ExportConfiguration>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ExportConfiguration>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <NotificationTarget>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <NotificationTarget>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <NotificationConfig>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <NotificationConfig>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <NotificationConfigResult>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <NotificationConfigResult>("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <AlertingBugtrackerSettings>("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <AlertingBugtrackerSettings>("type")); CustomInitialize(); }
private Teams setTeamTurn(Teams _team) { teamsTurn = _team; setTeamFlag(); return(teamsTurn); }
public async Task <TeamV> GetTeam(Guid teamKey, DateTime viewDate) { return((await Teams.SingleOrDefaultAsync(f => f.PrimaryKey == teamKey)).GetApprovedVersion(viewDate)); }
public CRRB_Rose(Teams team) : base(team) { Type = PieceTypes.CRRBRose; }
private async Task Loop(CancellationToken cancellationToken) { var teams = new Teams { Blue = ImmutableList.Create(MatchTesting.TestVenonatForOverlay), Red = ImmutableList.Create(MatchTesting.TestVenonatForOverlay), }; await Task.Delay(TimeSpan.FromSeconds(3), cancellationToken); await ResetBalances(); //ensure everyone has money to bet before the betting period const int matchId = -1; // TODO IBettingShop<User> bettingShop = new DefaultBettingShop<User>( async user => await _pokeyenBank.GetAvailableMoney(user)); bettingShop.BetPlaced += (_, args) => TaskToVoidSafely(_logger, () => _overlayConnection.Send(new MatchPokeyenBetUpdateEvent { MatchId = matchId, DefaultAction = "", NewBet = new Bet { Amount = args.Amount, Team = args.Side, BetBonus = 0 }, NewBetUser = args.User, Odds = bettingShop.GetOdds() }, cancellationToken)); _bettingPeriod = new BettingPeriod<User>(_pokeyenBank, bettingShop); _bettingPeriod.Start(); IMatchCycle match = new CoinflipMatchCycle(_loggerFactory.CreateLogger<CoinflipMatchCycle>()); Task setupTask = match.SetUp(new MatchInfo(teams.Blue, teams.Red), cancellationToken); await _overlayConnection.Send(new MatchCreatedEvent(), cancellationToken); await _overlayConnection.Send(new MatchBettingEvent(), cancellationToken); await _overlayConnection.Send(new MatchModesChosenEvent(), cancellationToken); // TODO await _overlayConnection.Send(new MatchSettingUpEvent { MatchId = 1234, Teams = teams, BettingDuration = _matchmodeConfig.DefaultBettingDuration.TotalSeconds, RevealDuration = 0, Gimmick = "speed", Switching = SwitchingPolicy.Never, BattleStyle = BattleStyle.Singles, InputOptions = new InputOptions { Moves = new MovesInputOptions { Policy = MoveSelectingPolicy.Always, Permitted = ImmutableList.Create("a", "b", "c", "d") }, Switches = new SwitchesInputOptions { Policy = SwitchingPolicy.Never, Permitted = ImmutableList<string>.Empty, RandomChance = 0 }, Targets = new TargetsInputOptions { Policy = TargetingPolicy.Disabled, Permitted = ImmutableList<string>.Empty, AllyHitChance = 0 }, }, BetBonus = 35, BetBonusType = "bet", }, cancellationToken); Duration bettingBeforeWarning = _matchmodeConfig.DefaultBettingDuration - _matchmodeConfig.WarningDuration; await Task.Delay(bettingBeforeWarning.ToTimeSpan(), cancellationToken); await _overlayConnection.Send(new MatchWarningEvent(), cancellationToken); await Task.Delay(_matchmodeConfig.WarningDuration.ToTimeSpan(), cancellationToken); await setupTask; _bettingPeriod.Close(); Task<MatchResult> performTask = match.Perform(cancellationToken); await _overlayConnection.Send(new MatchPerformingEvent { Teams = teams }, cancellationToken); MatchResult result = await performTask; await _overlayConnection.Send(new MatchOverEvent { MatchResult = result }, cancellationToken); // TODO log matches Dictionary<User, long> changes = await _bettingPeriod.Resolve(matchId, result, cancellationToken); await _overlayConnection.Send( new MatchResultsEvent { PokeyenResults = new PokeyenResults { Transactions = changes.ToImmutableDictionary(kvp => kvp.Key.Id, kvp => new Transaction { Change = kvp.Value, NewBalance = kvp.Key.Pokeyen }) } }, cancellationToken); await Task.Delay(_matchmodeConfig.ResultDuration.ToTimeSpan(), cancellationToken); await _overlayConnection.Send(new ResultsFinishedEvent(), cancellationToken); }
public void TestValidateMethod() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); bool test = true; Performance myPerformance1 = new Performance("A", "AA", 1.1m); Performance myPerformance2 = new Performance("B", "BB", 2.2m); Performance myPerformance3 = new Performance("C", "CC", 3.3m); Performance myPerformance4 = new Performance("D", "DD", 4.1m); Performance myPerformance5 = new Performance("", "DD", 4.1m); List <Performance> myPerformancesA = new List <Performance>(); myPerformancesA.Add(myPerformance1); myPerformancesA.Add(myPerformance2); List <Performance> myPerformancesB = new List <Performance>(); myPerformancesB.Add(myPerformance3); myPerformancesB.Add(myPerformance4); List <Performance> myPerformancesC = new List <Performance>(); myPerformancesC.Add(myPerformance5); //Events Dictionary <string, List <Performance> > myEventsA = new Dictionary <string, List <Performance> >(); myEventsA.Add("Boy's 100", myPerformancesA); myEventsA.Add("Boy's 200", myPerformancesB); Dictionary <string, List <Performance> > myEventsB = new Dictionary <string, List <Performance> >(); myEventsB.Add("Boy's 100", myPerformancesA); myEventsB.Add("Boy's 200", myPerformancesB); myEventsB.Add("Boy's 400", myPerformancesC); Dictionary <string, List <Performance> > myEventsC = new Dictionary <string, List <Performance> >(); myEventsC.Add("Boy's 100", myPerformancesA); myEventsC.Add("200", myPerformancesB); //Team Names Dictionary <string, string> boysNamesA = new Dictionary <string, string>(); boysNamesA.Add("BLN", "Baldwin"); boysNamesA.Add("TJ", "Thomas Jefferson"); boysNamesA.Add("WHS", "Washington HS"); Dictionary <string, string> dupBoysNames = new Dictionary <string, string>(); dupBoysNames.Add("BLN", "Baldwin"); dupBoysNames.Add("TJ", "Thomas Jefferson"); dupBoysNames.Add("BLD", "Baldwin"); Dictionary <string, string> boysNamesC = new Dictionary <string, string>(); boysNamesC.Add("BLN", "Baldwin"); boysNamesC.Add("TJ", "Thomas Jefferson"); boysNamesC.Add("", "Washinton HS"); Dictionary <string, string> girlsNamesA = new Dictionary <string, string>(); girlsNamesA.Add("PLM", "Plum"); girlsNamesA.Add("GWY", "Gateway"); girlsNamesA.Add("KCH", "Knoch"); Dictionary <string, string> dupGirlsNames = new Dictionary <string, string>(); dupGirlsNames.Add("PLM", "Plum"); dupGirlsNames.Add("GWY", "Gateway"); dupGirlsNames.Add("PM", "Plum"); Dictionary <string, string> girlsNamesC = new Dictionary <string, string>(); girlsNamesC.Add("PLM", "Plum"); girlsNamesC.Add("GWY", "Gateway"); girlsNamesC.Add("KCH", ""); Dictionary <string, string> overAbbr = new Dictionary <string, string>(); overAbbr.Add("PLM", "Plum"); overAbbr.Add("GATE", "Gateway"); overAbbr.Add("KCH", "Kiski"); Teams teams1 = new Teams(boysNamesA, girlsNamesA); Teams teams2 = new Teams(dupBoysNames, girlsNamesA); Teams teams3 = new Teams(boysNamesC, girlsNamesA); Teams teams4 = new Teams(boysNamesA, girlsNamesC); Teams teams5 = new Teams(boysNamesA, dupGirlsNames); Teams teams6 = new Teams(overAbbr, girlsNamesA); Teams teams7 = new Teams(boysNamesA, overAbbr); Meet validMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1, myEventsA); Meet validNoEventsMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1); Meet invalidDateTime = new Meet(DateTime.MinValue, "Baldwin HS", "Windy", teams1, myEventsA); Meet invalidLocation1 = new Meet(new DateTime(2017, 04, 13), null, "Windy", teams1, myEventsA); Meet invalidWeather1 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", null, teams1, myEventsA); Meet invalidLocation2 = new Meet(new DateTime(2017, 04, 13), "", "Windy", teams1, myEventsA); Meet invalidWeather2 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "", teams1, myEventsA); Meet dupBoysNameMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams2, myEventsA); Meet dupGirlsNameMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams5, myEventsA); Meet overBoysAbbrMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams6, myEventsA); Meet overGirlsAbbrMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams7, myEventsA); Meet invalidBoysName = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams3, myEventsA); Meet invalidGirlsName = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams4, myEventsA); Meet invalidPerformance = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1, myEventsB); Meet invalidEventName = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams1, myEventsC); if (!validMeet.validate()) { test = false; Console.WriteLine("validMeet failed"); } if (!validNoEventsMeet.validate()) { test = false; Console.WriteLine("validNoEventsMeet failed"); } if (invalidDateTime.validate()) { test = false; Console.WriteLine("invalidDateTime was valid"); } if (invalidLocation1.validate()) { test = false; Console.WriteLine("invalidLocation1 was valid"); } if (invalidLocation2.validate()) { test = false; Console.WriteLine("invalidLocation2 was valid"); } if (invalidWeather1.validate()) { test = false; Console.WriteLine("invalidWeather1 was valid"); } if (invalidWeather2.validate()) { test = false; Console.WriteLine("invalidWeather2 was valid"); } if (dupBoysNameMeet.validate()) { test = false; Console.WriteLine("dupBoysNameMeet was valid"); } if (dupGirlsNameMeet.validate()) { test = false; Console.WriteLine("dupGirlsNameMeet was valid"); } if (overBoysAbbrMeet.validate()) { test = false; Console.WriteLine("overBoysAbbrMeet was valid"); } if (overGirlsAbbrMeet.validate()) { test = false; Console.WriteLine("overGirlsAbbrMeet was valid"); } if (invalidBoysName.validate()) { test = false; Console.WriteLine("invalidBoysName was valid"); } if (invalidGirlsName.validate()) { test = false; Console.WriteLine("invalidGirlsName was valid"); } if (invalidPerformance.validate()) { test = false; Console.WriteLine("invalidPerformance was valid"); } if (invalidEventName.validate()) { test = false; Console.WriteLine("invalidEventName was valid"); } else { Console.WriteLine("TestValidateMethod Passed!"); } Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
public ServerChampion(ulong id, Vec2 pos, ChampionTypes type, Teams team) : base(id, pos, type, team) { }
public void TestToStringMethod() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); Performance myPerformance1 = new Performance("A", "AA", 1.1m); Performance myPerformance2 = new Performance("B", "BB", 2.2m); Performance myPerformance3 = new Performance("C", "CC", 3.3m); Performance myPerformance4 = new Performance("D", "DD", 4.1m); List <Performance> myPerformancesA = new List <Performance>(); myPerformancesA.Add(myPerformance1); myPerformancesA.Add(myPerformance2); List <Performance> myPerformancesB = new List <Performance>(); myPerformancesB.Add(myPerformance3); myPerformancesB.Add(myPerformance4); Dictionary <string, List <Performance> > myEventsA = new Dictionary <string, List <Performance> >(); myEventsA.Add("Boy's 100", myPerformancesA); myEventsA.Add("Boy's 200", myPerformancesB); Dictionary <string, string> boysNamesA = new Dictionary <string, string>(); boysNamesA.Add("BLN", "Baldwin"); boysNamesA.Add("TJ", "Thomas Jefferson"); boysNamesA.Add("WHS", "Washington HS"); Dictionary <string, string> girlsNamesA = new Dictionary <string, string>(); girlsNamesA.Add("PLM", "Plum"); girlsNamesA.Add("GWY", "Gateway"); girlsNamesA.Add("KCH", "Knoch"); Teams teams = new Teams(boysNamesA, girlsNamesA); Meet myMeet = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams, myEventsA); string strMeet = myMeet.ToString(); Console.WriteLine("My string:" + Environment.NewLine + Environment.NewLine); Console.WriteLine(strMeet + Environment.NewLine); Console.WriteLine("Expecting:" + Environment.NewLine + Environment.NewLine); Console.WriteLine("Date: 04/13/2017" + Environment.NewLine + "Location: " + "Baldwin HS" + Environment.NewLine + "Weather Conditions: " + "Windy" + Environment.NewLine + "Teams:" + Environment.NewLine + "Boys:" + Environment.NewLine + "Baldwin - BLN" + Environment.NewLine + "Thomas Jefferson - TJ" + Environment.NewLine + "Washington HS - WHS" + Environment.NewLine + "Girls:" + Environment.NewLine + "Plum - PLM" + Environment.NewLine + "Gateway - GWY" + Environment.NewLine + "Knoch - KCH" + Environment.NewLine + "Event: " + "Boy's 100" + Environment.NewLine + "Name: " + "A" + ", " + "AA" + " - " + 1.1 + Environment.NewLine + "Name: " + "B" + ", " + "BB" + " - " + 2.2 + Environment.NewLine + "Event: " + "Boy's 200" + Environment.NewLine + "Name: " + "C" + ", " + "CC" + " - " + 3.3 + Environment.NewLine + "Name: " + "D" + ", " + "DD" + " - " + 4.1); Assert.AreEqual(strMeet, "Date: 04/13/2017" + Environment.NewLine + "Location: " + "Baldwin HS" + Environment.NewLine + "Weather Conditions: " + "Windy" + Environment.NewLine + "Teams:" + Environment.NewLine + "Boys:" + Environment.NewLine + "Baldwin - BLN" + Environment.NewLine + "Thomas Jefferson - TJ" + Environment.NewLine + "Washington HS - WHS" + Environment.NewLine + "Girls:" + Environment.NewLine + "Plum - PLM" + Environment.NewLine + "Gateway - GWY" + Environment.NewLine + "Knoch - KCH" + Environment.NewLine + "Event: " + "Boy's 100" + Environment.NewLine + "Name: " + "A" + ", " + "AA" + " - " + 1.1 + Environment.NewLine + "Name: " + "B" + ", " + "BB" + " - " + 2.2 + Environment.NewLine + "Event: " + "Boy's 200" + Environment.NewLine + "Name: " + "C" + ", " + "CC" + " - " + 3.3 + Environment.NewLine + "Name: " + "D" + ", " + "DD" + " - " + 4.1, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
public void SetUnityNetworkPrefab(Teams teamId, GameObject unetPrefab) { GetCharacter(teamId).SetUnityNetworkPrefab(unetPrefab); }
public ArenaTeam GetTeam(PlayerMobile pm) { return(Teams.FirstOrDefault(team => team.Contains(pm))); }
public void NextTurn() { if (turn == Teams.Red) turn = Teams.Blue; else turn = Teams.Red; gameState = GameStates.StandBy; Debug.Log (turn.ToString () + " team's turn"); passingTurn(); }
public void TestParameterizedConstructor() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); bool test = true; Performance myPerformance1 = new Performance("A", "AA", 1.1m); Performance myPerformance2 = new Performance("B", "BB", 2.2m); Performance myPerformance3 = new Performance("C", "CC", 3.3m); Performance myPerformance4 = new Performance("D", "AA", 4.1m); Performance myPerformance5 = new Performance("E", "BB", 5.2m); Performance myPerformance6 = new Performance("F", "CC", 6.3m); List <Performance> myPerformancesA = new List <Performance>(); myPerformancesA.Add(myPerformance1); myPerformancesA.Add(myPerformance2); myPerformancesA.Add(myPerformance3); List <Performance> myPerformancesB = new List <Performance>(); myPerformancesB.Add(myPerformance4); myPerformancesB.Add(myPerformance5); myPerformancesB.Add(myPerformance6); Dictionary <string, List <Performance> > myPerformances = new Dictionary <string, List <Performance> >(); myPerformances.Add("Boy's 100", myPerformancesA); myPerformances.Add("Boy's 200", myPerformancesB); Dictionary <string, string> boysNames = new Dictionary <string, string>(); boysNames.Add("BLN", "Baldwin"); boysNames.Add("TJ", "Thomas Jefferson"); boysNames.Add("WHS", "Washington HS"); Dictionary <string, string> girlsNames = new Dictionary <string, string>(); girlsNames.Add("PLM", "Plum"); girlsNames.Add("GWY", "Gateway"); girlsNames.Add("KCH", "Knoch"); Teams teams = new Teams(boysNames, girlsNames); Meet myMeetNoEvents = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams); if (myMeetNoEvents.dateOfMeet != new DateTime(2017, 04, 13)) { test = false; Console.WriteLine("myMeetNoEvents - Invalid date"); } if (myMeetNoEvents.location != "Baldwin HS") { test = false; Console.WriteLine("myMeetNoEvents - Invalid location"); } if (myMeetNoEvents.weatherConditions != "Windy") { test = false; Console.WriteLine("myMeetNoEvents - Invalid weather conditions"); } if (!myMeetNoEvents.schoolNames.Equals(teams)) { test = false; Console.WriteLine("myMeetNoEvents - Invalid Teams object"); } Meet myMeetWithEvents = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams, myPerformances); if (myMeetWithEvents.dateOfMeet != new DateTime(2017, 04, 13)) { test = false; Console.WriteLine("myMeetWithEvents - Invalid date"); } if (myMeetWithEvents.location != "Baldwin HS") { test = false; Console.WriteLine("myMeetWithEvents - Invalid location"); } if (myMeetWithEvents.weatherConditions != "Windy") { test = false; Console.WriteLine("myMeetWithEvents - Invalid weather conditions"); } if (!myMeetWithEvents.schoolNames.Equals(teams)) { test = false; Console.WriteLine("myMeetWithEvents - Invalid Teams object"); } if (!myMeetWithEvents.performances.SequenceEqual(myPerformances)) { test = false; Console.WriteLine("Invalid performances"); } Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
public void TestAddNewIndividualPerformance() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); Dictionary <string, string> boysNames = new Dictionary <string, string>(); boysNames.Add("BLN", "Baldwin"); boysNames.Add("TJ", "Thomas Jefferson"); boysNames.Add("WHS", "Washington HS"); Dictionary <string, string> girlsNames = new Dictionary <string, string>(); girlsNames.Add("PLM", "Plum"); girlsNames.Add("GWY", "Gateway"); girlsNames.Add("KCH", "Knoch"); Teams teams = new Teams(boysNames, girlsNames); Performance myPerformance1 = new Performance("A", "AA", 1.1m); Performance myPerformance2 = new Performance("B", "BB", 2.2m); Performance myPerformance3 = new Performance("C", "CC", 3.3m); Performance myPerformance4 = new Performance("D", "AA", 4.1m); Performance myPerformance5 = new Performance("E", "BB", 5.2m); Performance myPerformance6 = new Performance("F", "CC", 6.3m); Performance myPerformance7 = new Performance("G", "DD", 4.4m); List <Performance> myPerformancesA = new List <Performance>(); myPerformancesA.Add(myPerformance1); myPerformancesA.Add(myPerformance2); myPerformancesA.Add(myPerformance3); List <Performance> myPerformancesB = new List <Performance>(); myPerformancesB.Add(myPerformance4); myPerformancesB.Add(myPerformance5); myPerformancesB.Add(myPerformance6); List <Performance> myPerformancesC = new List <Performance>(); myPerformancesC.Add(myPerformance7); Dictionary <string, List <Performance> > originalList = new Dictionary <string, List <Performance> >(); originalList.Add("Boy's 100", myPerformancesA); originalList.Add("Boy's 200", myPerformancesB); Dictionary <string, List <Performance> > newComparableList = new Dictionary <string, List <Performance> >(); newComparableList.Add("Boy's 100", myPerformancesA); newComparableList.Add("Boy's 200", myPerformancesB); newComparableList.Add("Boy's 400", myPerformancesC); Meet meet1 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams, originalList); Meet meet2 = new Meet(new DateTime(2017, 04, 13), "Baldwin HS", "Windy", teams, newComparableList); DataEntrySvcImpl DESI = new DataEntrySvcImpl(); meet1.performances = DESI.AddPerformanceToEvent(meet1.performances, "Boy's 400", myPerformancesC); Console.WriteLine("originalList:"); foreach (KeyValuePair <string, List <Performance> > kvp in originalList) { foreach (Performance i in kvp.Value) { Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, i.ToString()); } } Console.WriteLine("\nnewComparableList:"); foreach (KeyValuePair <string, List <Performance> > kvp in newComparableList) { foreach (Performance i in kvp.Value) { Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, i.ToString()); } } bool test = meet1.Equals(meet2); Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }
public CRRB_SuperKnight(Teams team) : base(team) { Type = PieceTypes.CRRBSuperKnight; }
public RSR ClearTeams() { return(Teams.ClearTeams()); }
public SoccerQuery(ITeamsProvider teamsProvider, IStatsProvider statsProvider) { Teams.Add(teamsProvider, this); Stats.Add(statsProvider, this); WinnigStats.Add(statsProvider, this); }
public async Task Update(long id, string name) { await User.Identity.RootTeamsProxy.UpdateNode(id, Teams.Set(p => p.Name, name)); }
protected void cmdCreate_Click(object sender, EventArgs e) { panAlert.Visible = true; if (txtLocation.Text == "") { lblAlert.Text = "Please enter a location"; } else if (txtWeather.Text == "") { lblAlert.Text = "Please enter weather conditions"; } else if (string.IsNullOrWhiteSpace(txtBoysTeam1.Text) || string.IsNullOrWhiteSpace(txtBoysAbbr1.Text)) { lblAlert.Text = "Please enter team name information for boy's team #1"; } else if ((string.IsNullOrWhiteSpace(txtBoysTeam2.Text) && !string.IsNullOrWhiteSpace(txtBoysAbbr2.Text)) || (!string.IsNullOrWhiteSpace(txtBoysTeam2.Text) && string.IsNullOrWhiteSpace(txtBoysAbbr2.Text))) { lblAlert.Text = "Invalid name information for boy's team #2"; } else if ((string.IsNullOrWhiteSpace(txtBoysTeam3.Text) && !string.IsNullOrWhiteSpace(txtBoysAbbr3.Text)) || (!string.IsNullOrWhiteSpace(txtBoysTeam3.Text) && string.IsNullOrWhiteSpace(txtBoysAbbr3.Text))) { lblAlert.Text = "Invalid name information for boy's team #3"; } else if ((string.IsNullOrWhiteSpace(txtBoysTeam4.Text) && !string.IsNullOrWhiteSpace(txtBoysAbbr4.Text)) || (!string.IsNullOrWhiteSpace(txtBoysTeam4.Text) && string.IsNullOrWhiteSpace(txtBoysAbbr4.Text))) { lblAlert.Text = "Invalid name information for boy's team #4"; } else if ((string.IsNullOrWhiteSpace(txtBoysTeam5.Text) && !string.IsNullOrWhiteSpace(txtBoysAbbr5.Text)) || (!string.IsNullOrWhiteSpace(txtBoysTeam5.Text) && string.IsNullOrWhiteSpace(txtBoysAbbr5.Text))) { lblAlert.Text = "Invalid name information for boy's team #5"; } else if ((string.IsNullOrWhiteSpace(txtBoysTeam6.Text) && !string.IsNullOrWhiteSpace(txtBoysAbbr6.Text)) || (!string.IsNullOrWhiteSpace(txtBoysTeam6.Text) && string.IsNullOrWhiteSpace(txtBoysAbbr6.Text))) { lblAlert.Text = "Invalid name information for boy's team #6"; } else if (string.IsNullOrWhiteSpace(txtGirlsTeam1.Text) || string.IsNullOrWhiteSpace(txtGirlsAbbr1.Text)) { lblAlert.Text = "Please enter team name information for girl's team #1"; } else if ((string.IsNullOrWhiteSpace(txtGirlsTeam2.Text) && !string.IsNullOrWhiteSpace(txtGirlsAbbr2.Text)) || (!string.IsNullOrWhiteSpace(txtGirlsTeam2.Text) && string.IsNullOrWhiteSpace(txtGirlsAbbr2.Text))) { lblAlert.Text = "Invalid name information for girl's team #2"; } else if ((string.IsNullOrWhiteSpace(txtGirlsTeam3.Text) && !string.IsNullOrWhiteSpace(txtGirlsAbbr3.Text)) || (!string.IsNullOrWhiteSpace(txtGirlsTeam3.Text) && string.IsNullOrWhiteSpace(txtGirlsAbbr3.Text))) { lblAlert.Text = "Invalid name information for girl's team #3"; } else if ((string.IsNullOrWhiteSpace(txtGirlsTeam4.Text) && !string.IsNullOrWhiteSpace(txtGirlsAbbr4.Text)) || (!string.IsNullOrWhiteSpace(txtGirlsTeam4.Text) && string.IsNullOrWhiteSpace(txtGirlsAbbr4.Text))) { lblAlert.Text = "Invalid name information for girl's team #4"; } else if ((string.IsNullOrWhiteSpace(txtGirlsTeam5.Text) && !string.IsNullOrWhiteSpace(txtGirlsAbbr5.Text)) || (!string.IsNullOrWhiteSpace(txtGirlsTeam5.Text) && string.IsNullOrWhiteSpace(txtGirlsAbbr5.Text))) { lblAlert.Text = "Invalid name information for girl's team #5"; } else if ((string.IsNullOrWhiteSpace(txtGirlsTeam6.Text) && !string.IsNullOrWhiteSpace(txtGirlsAbbr6.Text)) || (!string.IsNullOrWhiteSpace(txtGirlsTeam6.Text) && string.IsNullOrWhiteSpace(txtGirlsAbbr6.Text))) { lblAlert.Text = "Invalid name information for girl's team #6"; } else { string meetLocation = txtLocation.Text; int month = 1; if (ddlMonth.Text == "February") { month = 2; } else if (ddlMonth.Text == "March") { month = 3; } else if (ddlMonth.Text == "April") { month = 4; } else if (ddlMonth.Text == "May") { month = 5; } else if (ddlMonth.Text == "June") { month = 6; } else if (ddlMonth.Text == "July") { month = 7; } else if (ddlMonth.Text == "August") { month = 8; } else if (ddlMonth.Text == "September") { month = 9; } else if (ddlMonth.Text == "October") { month = 10; } else if (ddlMonth.Text == "November") { month = 11; } else if (ddlMonth.Text == "December") { month = 12; } DateTime meetDateTime = new DateTime(Convert.ToInt32(ddlYear.Text), month, Convert.ToInt32(ddlDay.Text)); string meetWeather = txtWeather.Text; string boysTeam1Abbr = txtBoysAbbr1.Text.Trim(); string boysTeam1Name = txtBoysTeam1.Text.Trim(); string boysTeam2Abbr = txtBoysAbbr2.Text.Trim(); string boysTeam2Name = txtBoysTeam2.Text.Trim(); string boysTeam3Abbr = txtBoysAbbr3.Text.Trim(); string boysTeam3Name = txtBoysTeam3.Text.Trim(); string boysTeam4Abbr = txtBoysAbbr4.Text.Trim(); string boysTeam4Name = txtBoysTeam4.Text.Trim(); string boysTeam5Abbr = txtBoysAbbr5.Text.Trim(); string boysTeam5Name = txtBoysTeam5.Text.Trim(); string boysTeam6Abbr = txtBoysAbbr6.Text.Trim(); string boysTeam6Name = txtBoysTeam6.Text.Trim(); string girlsTeam1Abbr = txtGirlsAbbr1.Text.Trim(); string girlsTeam1Name = txtGirlsTeam1.Text.Trim(); string girlsTeam2Abbr = txtGirlsAbbr2.Text.Trim(); string girlsTeam2Name = txtGirlsTeam2.Text.Trim(); string girlsTeam3Abbr = txtGirlsAbbr3.Text.Trim(); string girlsTeam3Name = txtGirlsTeam3.Text.Trim(); string girlsTeam4Abbr = txtGirlsAbbr4.Text.Trim(); string girlsTeam4Name = txtGirlsTeam4.Text.Trim(); string girlsTeam5Abbr = txtGirlsAbbr5.Text.Trim(); string girlsTeam5Name = txtGirlsTeam5.Text.Trim(); string girlsTeam6Abbr = txtGirlsAbbr6.Text.Trim(); string girlsTeam6Name = txtGirlsTeam6.Text.Trim(); List <string> boysNames = new List <string>(); if (!string.IsNullOrWhiteSpace(boysTeam1Name)) { boysNames.Add(boysTeam1Name); } if (!string.IsNullOrWhiteSpace(boysTeam2Name)) { boysNames.Add(boysTeam2Name); } if (!string.IsNullOrWhiteSpace(boysTeam3Name)) { boysNames.Add(boysTeam3Name); } if (!string.IsNullOrWhiteSpace(boysTeam4Name)) { boysNames.Add(boysTeam4Name); } if (!string.IsNullOrWhiteSpace(boysTeam5Name)) { boysNames.Add(boysTeam5Name); } if (!string.IsNullOrWhiteSpace(boysTeam6Name)) { boysNames.Add(boysTeam6Name); } List <string> boysAbbrs = new List <string>(); if (!string.IsNullOrWhiteSpace(boysTeam1Abbr)) { boysAbbrs.Add(boysTeam1Abbr); } if (!string.IsNullOrWhiteSpace(boysTeam2Abbr)) { boysAbbrs.Add(boysTeam2Abbr); } if (!string.IsNullOrWhiteSpace(boysTeam3Abbr)) { boysAbbrs.Add(boysTeam3Abbr); } if (!string.IsNullOrWhiteSpace(boysTeam4Abbr)) { boysAbbrs.Add(boysTeam4Abbr); } if (!string.IsNullOrWhiteSpace(boysTeam5Abbr)) { boysAbbrs.Add(boysTeam5Abbr); } if (!string.IsNullOrWhiteSpace(boysTeam6Abbr)) { boysAbbrs.Add(boysTeam6Abbr); } List <string> girlsNames = new List <string>(); if (!string.IsNullOrWhiteSpace(girlsTeam1Name)) { girlsNames.Add(girlsTeam1Name); } if (!string.IsNullOrWhiteSpace(girlsTeam2Name)) { girlsNames.Add(girlsTeam2Name); } if (!string.IsNullOrWhiteSpace(girlsTeam3Name)) { girlsNames.Add(girlsTeam3Name); } if (!string.IsNullOrWhiteSpace(girlsTeam4Name)) { girlsNames.Add(girlsTeam4Name); } if (!string.IsNullOrWhiteSpace(girlsTeam5Name)) { girlsNames.Add(girlsTeam5Name); } if (!string.IsNullOrWhiteSpace(girlsTeam6Name)) { girlsNames.Add(girlsTeam6Name); } List <string> girlsAbbrs = new List <string>(); if (!string.IsNullOrWhiteSpace(girlsTeam1Abbr)) { girlsAbbrs.Add(girlsTeam1Abbr); } if (!string.IsNullOrWhiteSpace(girlsTeam2Abbr)) { girlsAbbrs.Add(girlsTeam2Abbr); } if (!string.IsNullOrWhiteSpace(girlsTeam3Abbr)) { girlsAbbrs.Add(girlsTeam3Abbr); } if (!string.IsNullOrWhiteSpace(girlsTeam4Abbr)) { girlsAbbrs.Add(girlsTeam4Abbr); } if (!string.IsNullOrWhiteSpace(girlsTeam5Abbr)) { girlsAbbrs.Add(girlsTeam5Abbr); } if (!string.IsNullOrWhiteSpace(girlsTeam6Abbr)) { girlsAbbrs.Add(girlsTeam6Abbr); } if (boysNames.Distinct().Count() != boysNames.Count()) { lblAlert.Text = "All Boy's names must be unique"; } else if (boysAbbrs.Distinct().Count() != boysAbbrs.Count()) { lblAlert.Text = "All Boy's abbrs must be unique"; } else if (girlsNames.Distinct().Count() != girlsNames.Count()) { lblAlert.Text = "All Girl's names must be unique"; } else if (girlsAbbrs.Distinct().Count() != girlsAbbrs.Count()) { lblAlert.Text = "All Girl's abbrs must be unique"; } else { Dictionary <string, string> boysTeams = new Dictionary <string, string>(); boysTeams.Add(boysTeam1Abbr, boysTeam1Name); if (!string.IsNullOrWhiteSpace(boysTeam2Abbr)) { boysTeams.Add(boysTeam2Abbr, boysTeam2Name); } if (!string.IsNullOrWhiteSpace(boysTeam3Abbr)) { boysTeams.Add(boysTeam3Abbr, boysTeam3Name); } if (!string.IsNullOrWhiteSpace(boysTeam4Abbr)) { boysTeams.Add(boysTeam4Abbr, boysTeam4Name); } if (!string.IsNullOrWhiteSpace(boysTeam5Abbr)) { boysTeams.Add(boysTeam5Abbr, boysTeam5Name); } if (!string.IsNullOrWhiteSpace(boysTeam6Abbr)) { boysTeams.Add(boysTeam6Abbr, boysTeam6Name); } Dictionary <string, string> girlsTeams = new Dictionary <string, string>(); girlsTeams.Add(girlsTeam1Abbr, girlsTeam1Name); if (!string.IsNullOrWhiteSpace(girlsTeam2Abbr)) { girlsTeams.Add(girlsTeam2Abbr, girlsTeam2Name); } if (!string.IsNullOrWhiteSpace(girlsTeam3Abbr)) { girlsTeams.Add(girlsTeam3Abbr, girlsTeam3Name); } if (!string.IsNullOrWhiteSpace(girlsTeam4Abbr)) { girlsTeams.Add(girlsTeam4Abbr, girlsTeam4Name); } if (!string.IsNullOrWhiteSpace(girlsTeam5Abbr)) { girlsTeams.Add(girlsTeam5Abbr, girlsTeam5Name); } if (!string.IsNullOrWhiteSpace(girlsTeam6Abbr)) { girlsTeams.Add(girlsTeam6Abbr, girlsTeam6Name); } Teams newTeams = new Teams(boysTeams, girlsTeams); newMeet = new Meet(meetDateTime, meetLocation, meetWeather, newTeams); if (newMeet.validate()) { DatabaseMgr dm = new DatabaseMgr(); meetID = dm.FindMeetId(newMeet); if (meetID < 0) { panAlert.GroupingText = "Problem loading meet database. Please try again later"; } else { if (meetID == 0) //Meet does not exist in database { bool didAdd = dm.AddMeet(newMeet, Session["Username"].ToString()); if (didAdd) { Session["ActiveMeet"] = newMeet; //Open MeetHub here Response.Redirect("MeetHub.aspx"); } else { lblAlert.Text = "Problem addign meet to database, please try again later"; } } else { panAlert.Visible = false; panDatabaseAlert.Visible = true; lblDatabaseAlert.Text = "Meet already exists, do you wish to overwrite existing meet, or open existing meet?"; cmdCreate.Visible = false; } } } else { lblAlert.Text = "Unknown problem creating this meet. Data was invalid."; } } } }
public void Init() { BlueTeam = new List<Client>(); GreenTeam = new List<Client>(); PlayerCount = 0; GreenPoints = 0; BluePoints = 0; Random rand = new Random(); LastAdded = (Teams)rand.Next(0, 2); }
public void Apply(TeamCreated e) { var team = new Team(e, Id.Value); Teams.Add(team); }