Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenSauce committed Feb 24, 2021
1 parent 49bd95a commit edaa593
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
5 changes: 4 additions & 1 deletion MOBA-Manager/MOBA-Manager/Source/DataModel/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ public class Fixture
private Team homeTeam;
private Team awayTeam;

public Fixture(Team homeTeam, Team awayTeam)
public Fixture(Team homeTeam, Team awayTeam, DateTime matchTime)
{
this.matchTime = matchTime;
this.homeTeam = homeTeam;
this.awayTeam = awayTeam;
}
}
}
14 changes: 11 additions & 3 deletions MOBA-Manager/MOBA-Manager/Source/Utilities/FixtureBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
using MOBA_Manager.DataModel;
using MOBA_Manager.Game;
using MOBA_Manager.Source.DataModel;
using System;
using System.Collections.Generic;
using System.Linq;

namespace MOBA_Manager.Source.Utilities
{
public class FixtureBuilder
{
private Team playerTeam;

public List<Fixture> GetNewFixtures(DateTime startingDate)
public List<Fixture> GetNewFixtures(DateTime startingDate, Session playerSession)
{
throw new NotImplementedException();
List<Fixture> fixtureList = new List<Fixture>();
List<Team> teams = playerSession.TeamList;
for (int i = 0; i < teams.Count; i++)
{
Fixture f = new Fixture(playerSession.MainPlayer.Team, teams[i], startingDate);

}
return fixtureList;
}

}
Expand Down
8 changes: 5 additions & 3 deletions MOBA-Manager/MOBA-Manager/Source/Utilities/SessionDirector.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using MOBA_Manager.DataModel;
using MOBA_Manager.Source.DataModel;
using MOBA_Manager.Source.Utilities;
using System;
using System.Collections.Generic;

Expand Down Expand Up @@ -42,12 +43,11 @@ private void LoadGameEntities()
this.session.SetPlayerData(LoadPlayers());
this.session.BuyablePlayers = LoadBuyablePlayers();
this.session.SetTeamData(LoadTeams());
this.session.FixturesList = GenerateInitialFixtures();
}

private List<Fixture> GenerateInitialFixtures()
{
return new List<Fixture>();
return new FixtureBuilder().GetNewFixtures(this.session.GameTime, this.session);
}

private List<Player> LoadBuyablePlayers()
Expand Down Expand Up @@ -75,7 +75,9 @@ private void SetUserCreationUI()

public Session SetSessionUser(User user)
{
return this.session.SetUser(user);
this.session.SetUser(user);
this.session.FixturesList = GenerateInitialFixtures();
return this.session;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private List<Team> GenerateListOfTeams(List<Team> teamList)
return teamList;
}

private string[] GetTeamNames()
public static string[] GetTeamNames()
{
string[] teamNames = {
"Blue Azuls",
Expand Down

0 comments on commit edaa593

Please sign in to comment.