package MpmasNetworkObjectInfo;

use strict;
use warnings;
use Exporter;
use Storable qw(dclone);
use Data::Dumper;
use MpmasInputfile;
use MpmasInputBlock;
our @ISA = qw(MpmasInputfile);

sub filename {
	return "ObjectInfo";
}
sub extension {
	return ".txt";
}

sub leftmargin {
	return "";
}
sub prepare_special {
	my $self = shift;
	my $oinfo = MpmasInputBlock->new(0,10);
	$oinfo->add_row("ObjectID","Code","InnovationID","Name");	
	for my $i ($self->sorted_networkobjects) {
		my $k = $self->networkobject($i);
		$oinfo->add_row(  $k->oid,$i,$k->innovid, $k->get_attribute("name"));	
	}
	my %specobjname = %{$self->get_specobj_names()} ;
	my %specobjindex = %{$self->get_specobj_indices()};
	for my $k (sort {$self->config_entry("SPECOBJS")->[$specobjindex{$a}] <=> $self->config_entry("SPECOBJS")->[$specobjindex{$b}] } keys %specobjname) {
		$oinfo->add_row($self->config_entry("SPECOBJS")->[$specobjindex{$k}], $k, -1,$specobjname{$k});
	}
	$self->add_block($oinfo);
}
1;
