-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add InvestIntelPlayerAction stub on backend and make frontend call it…
… and get the response
- Loading branch information
Konrad Jamrozik
committed
Jun 29, 2024
1 parent
09dc10e
commit f2c5826
Showing
13 changed files
with
75 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Lib.Contracts; | ||
using UfoGameLib.Lib; | ||
using UfoGameLib.Model; | ||
using UfoGameLib.State; | ||
|
||
namespace UfoGameLib.Controller; | ||
|
||
public class InvestIntelPlayerAction : PlayerAction | ||
{ | ||
private readonly ILog _log; | ||
private readonly Faction _faction; | ||
private readonly int _intel; | ||
|
||
public InvestIntelPlayerAction(ILog log, Faction faction, int intel) | ||
{ | ||
Contract.Assert(intel >= 1); | ||
_log = log; | ||
_faction = faction; | ||
_intel = intel; | ||
} | ||
|
||
protected override (List<int>? ids, int? targetId) ApplyImpl(GameState state) | ||
{ | ||
// kja WIP InvestIntelPlayerAction | ||
|
||
Console.Out.WriteLine($"Invest intel. Faction: '{_faction.Name}', Faction ID: {_faction.Id}, Intel: {_intel}"); | ||
_log.Info($"Invest intel. Faction: '{_faction.Name}', Faction ID: {_faction.Id}, Intel: {_intel}"); | ||
|
||
return (ids: [_faction.Id], targetId: _intel); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters