#!/usr/bin/perl -w

# (c) Copyright by Tels 1999. All Rights Reserved.
# 2000-05-26 v0.0.1 - from scratch

use Cowgen::Bunch;  # for a bunch of brushes
use Cowgen::Dromed; # for some Thief constants and specifics
use Cowgen::Gamfile;
use Cowgen::Config qw(loadConfig);
use Cowgen::Vbr;
use strict 'vars';

my $VERSION = 0.01;
my $time = time;

print "Schema - show how to access/modify schemas in gamfile\n";
print "(c) Copyright by Tels 1999-2000. All Rights Reserved.\n\n";
print " Usage:     perl schema [infile [outfile]]\n\n";

my $infile = shift || "";
my $outfile = shift || "new.gam";

print "Reading file $infile...\n";
my $gf = Cowgen::Gamfile->create($infile);    # read file
print "done.\n";

my $al = $gf->archetypes(); # get the objlist that contains the archetypes, we will need it

##########################################################################
# add some voices

my $voice = $gf->addVoice ( "TestVoice" ); # add based on Voice
my $v1 = $gf->addVoice ( "TestVoice1", $voice ); # add based on TestVoice
my $v2 = $gf->addVoice ( "TestVoice2", $voice ); # add based on TestVoice

my $vi = $al->getProperty($voice,"voiceindex");
print "TestVoice is ID: $voice, voice index: $vi->[0]\n";
$vi = $al->getProperty($v1,"voiceindex");
print "TestVoice1 is ID: $v1, voice index: $vi->[0]\n";
$vi = $al->getProperty($v2,"voiceindex");
print "TestVoice2 is ID: $v2, voice index: $vi->[0]\n";

$gf->writeFile($outfile); # writeout

# EOF
1;

