mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 10:38:40 +00:00
Update activity system to use new team pick time
This commit is contained in:
parent
0f02a93a8d
commit
0445a0b3a6
2 changed files with 7 additions and 4 deletions
|
@ -673,7 +673,7 @@ public class ActivityEventHandlerTests
|
||||||
{
|
{
|
||||||
SlotId = 1,
|
SlotId = 1,
|
||||||
CreatorId = 1,
|
CreatorId = 1,
|
||||||
TeamPick = true,
|
TeamPickTime = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
eventHandler.OnEntityChanged(database, oldSlot, newSlot);
|
eventHandler.OnEntityChanged(database, oldSlot, newSlot);
|
||||||
|
|
|
@ -245,10 +245,13 @@ public class ActivityEntityEventHandler : IEntityEventHandler
|
||||||
{
|
{
|
||||||
if (origEntity is not SlotEntity oldSlotEntity) break;
|
if (origEntity is not SlotEntity oldSlotEntity) break;
|
||||||
|
|
||||||
switch (oldSlotEntity.TeamPick)
|
bool oldIsTeamPick = oldSlotEntity.TeamPickTime != 0;
|
||||||
|
bool newIsTeamPick = slotEntity.TeamPickTime != 0;
|
||||||
|
|
||||||
|
switch (oldIsTeamPick)
|
||||||
{
|
{
|
||||||
// When a level is team picked
|
// When a level is team picked
|
||||||
case false when slotEntity.TeamPick:
|
case false when newIsTeamPick:
|
||||||
activity = new LevelActivityEntity
|
activity = new LevelActivityEntity
|
||||||
{
|
{
|
||||||
Type = EventType.MMPickLevel,
|
Type = EventType.MMPickLevel,
|
||||||
|
@ -257,7 +260,7 @@ public class ActivityEntityEventHandler : IEntityEventHandler
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
// When a level has its team pick removed then remove the corresponding activity
|
// When a level has its team pick removed then remove the corresponding activity
|
||||||
case true when !slotEntity.TeamPick:
|
case true when !newIsTeamPick:
|
||||||
database.Activities.OfType<LevelActivityEntity>()
|
database.Activities.OfType<LevelActivityEntity>()
|
||||||
.Where(a => a.Type == EventType.MMPickLevel)
|
.Where(a => a.Type == EventType.MMPickLevel)
|
||||||
.Where(a => a.SlotId == slotEntity.SlotId)
|
.Where(a => a.SlotId == slotEntity.SlotId)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue