<commit_before>use v6;

use LacunaCookbuk::Model::Body::Planet;
use LacunaCookbuk::Logic::BodyBuilder;
use LacunaCookbuk::Model::Empire;
use LacunaCookbuk::Model::Structure::Trade;


class LacunaCookbuk::Logic::Transporter;

my role Cargo{
    method gather(Trade $Trade --> List) { ... }   
}

my class Glyphs does Cargo {
    

    method gather(Trade $trade --> List){
	$trade.get_glyphs;
    }

}

my class Plans does Cargo {
    
    method gather(Trade $trade --> List){
	$trade.get_plans;
    }
}

submethod transport(@goods,Planet $src, Planet $dst = home_planet)
{
    my @cargo;
    my $trade = $src.find_trade_ministry;
    return unless $trade;
    unless $trade.repaired {
        note "Cannot use TradeMinistry on " ~ $src.name;
        return;

    }
    for @goods -> $load {
	@cargo.push($load.gather($trade))
    }
    my $ship = $trade.find_fastest_ship;
    return unless $ship;

    my @packed = self.cut_size(@cargo, +$ship<hold_size>);
    say $trade.push(@packed) if @packed;   
}

submethod transport_all_cargo(Planet $dst = home_planet) {
    my @goods = (Glyphs, Plans);
    my @planets = planets;
    for @planets -> Planet $planet {
	#note $planet.name;	
	next if $planet.is_home;
	self.transport(@goods, $planet, $dst);
    }<commit_msg>Added log when no ship<commit_after>use v6;

use LacunaCookbuk::Model::Body::Planet;
use LacunaCookbuk::Logic::BodyBuilder;
use LacunaCookbuk::Model::Empire;
use LacunaCookbuk::Model::Structure::Trade;


class LacunaCookbuk::Logic::Transporter;

my role Cargo{
    method gather(Trade $Trade --> List) { ... }   
}

my class Glyphs does Cargo {
    

    method gather(Trade $trade --> List){
	$trade.get_glyphs;
    }

}

my class Plans does Cargo {
    
    method gather(Trade $trade --> List){
	$trade.get_plans;
    }
}

submethod transport(@goods,Planet $src, Planet $dst = home_planet)
{
    my @cargo;
    my $trade = $src.find_trade_ministry;
    return unless $trade;
    unless $trade.repaired {
        note "Cannot use TradeMinistry on " ~ $src.name;
        return;

    }
    for @goods -> $load {
	@cargo.push($load.gather($trade))
    }
    my $ship = $trade.find_fastest_ship;
    unless $ship {
        note "No ship available on {$src.name}";
        return;
    }

    my @packed = self.cut_size(@cargo, +$ship<hold_size>);
    say $trade.push(@packed) if @packed;   
}

submethod transport_all_cargo(Planet $dst = home_planet) {
    my @goods = (Glyphs, Plans);
    my @planets = planets;
    for @planets -> Planet $planet {
	#note $planet.name;	
	next if $planet.is_home;
	self.transport(@goods, $planet, $dst);
    }
{'fraction_non_alphanumeric': 0.14072085889570551, 'fraction_numerical': 0.0007668711656441718, 'mean_word_length': 3.249185667752443, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2964258', 'n_tokens_mistral': 1013, 'n_tokens_neox': 951, 'n_words': 218}