Saturday, 31 January 2026 01:00:43
This commit is contained in:
@@ -7,7 +7,7 @@ public partial class Enemy : Actor
|
||||
{
|
||||
public int _number;
|
||||
public Player _playerOpponent;
|
||||
public Cell _cell;
|
||||
public Shield _shield;
|
||||
public Enemy _owner;
|
||||
public List<GoalName> _defaultGoals = new();
|
||||
public List<GoalName> _goals = new();
|
||||
@@ -36,13 +36,13 @@ public partial class Enemy : Actor
|
||||
|
||||
public void CheckGoals()
|
||||
{
|
||||
List<Cell> ownedCells = _board.GetCellsByOwner(this);
|
||||
List<Shield> ownedShields = _board.GetShieldsByOwner(this);
|
||||
Goal goal = new Goal();
|
||||
for (int i = 0; i < _defaultGoals.Count; i++)
|
||||
{
|
||||
GoalName goalName = _defaultGoals[i];
|
||||
List<int> addresses = goal.GetAddresses(goalName);
|
||||
bool goalMet = addresses.All(a=>ownedCells.Select(c=>c._address).ToList().IndexOf(a)>-1);
|
||||
bool goalMet = addresses.All(a=>ownedShields.Select(c=>c._address).ToList().IndexOf(a)>-1);
|
||||
if (goalMet)
|
||||
{
|
||||
Victory(goalName);
|
||||
@@ -51,7 +51,7 @@ public partial class Enemy : Actor
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClickCell(Cell CLICKED_CELL)
|
||||
public virtual void ClickShield(Shield CLICKED_SHIELD)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public partial class Enemy : Actor
|
||||
_board._winningPattern = WINNING_PATTERN;
|
||||
if (_owner != null)
|
||||
{
|
||||
_owner._board.GetCellByTenant(this).Mark(_playerOpponent);
|
||||
// _owner._board.GetShieldByTenant(this).Mark(_playerOpponent);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public partial class Enemy : Actor
|
||||
_board._winningPattern = WINNING_PATTERN;
|
||||
if (_owner != null)
|
||||
{
|
||||
_owner._board.GetCellByTenant(this).Mark(this);
|
||||
_owner._board.GetShieldByTenant(this).Break();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user