Пример #1
0
    private void NetworkAttackUnitOfFleet(int fleetID, int unitPosition, int strength)
    {
        var fleet = FleetList.Find(f => f.ID == fleetID);

        if (fleet == null)
        {
            return;
        }

        fleet.AttackUnit(unitPosition, strength);
    }
Пример #2
0
    private void NetworkMoveFleet(int fleetID, Vector2 targetTilePosition)
    {
        var fleet = FleetList.Find(f => f.ID == fleetID);

        if (fleet == null)
        {
            return;
        }

        var currentTile = TileList.Find(t => t.Fleet == fleet);
        var targetTile  = TileList.Find(t => t.Position == targetTilePosition);

        targetTile.Fleet  = fleet;
        currentTile.Fleet = null;

        fleet.MoveFleet(targetTile.TileParent.position);
    }
Пример #3
0
    private void NetworkRotateFleet(int fleetID, bool rotateRight)
    {
        var fleet = FleetList.Find(f => f.ID == fleetID);

        fleet.RotateFleet(rotateRight ? 1 : -1);
    }