source: cpp/gdk/genotypeloader.cpp @ 57

Last change on this file since 57 was 5, checked in by sz, 16 years ago

added the GDK (Genotype Development Kit)

File size: 1.2 KB
Line 
1// This file is a part of Framsticks GDK library.
2// Copyright (C) 2002-2006  Szymon Ulatowski.  See LICENSE.txt for details.
3// Refer to http://www.frams.alife.pl/ for further information.
4
5#include "genotypeloader.h"
6
7#define FIELDSTRUCT MiniGenotype
8ParamEntry minigenotype_paramtab[]=
9 {
10 {"Genotype",1,3,"org",},
11 {"name",0,0,"Name","s 0 40",FIELD(name),},
12 {"genotype",0,0,"Genotype","s 1",FIELD(genotype),},
13 {"info",0,0,"Info","s 1",FIELD(info),},
14 {0,0,0,},
15};
16#undef FIELDSTRUCT
17
18MiniGenotypeLoader::MiniGenotypeLoader():genotype_param(minigenotype_paramtab,&genotype_object) {init();}
19MiniGenotypeLoader::MiniGenotypeLoader(VirtFILE *f):MultiParamLoader(f),genotype_param(minigenotype_paramtab,&genotype_object) {init();}
20MiniGenotypeLoader::MiniGenotypeLoader(const char* filename):MultiParamLoader(filename),genotype_param(minigenotype_paramtab,&genotype_object) {init();}
21
22void MiniGenotypeLoader::init()
23{
24addClass(&genotype_param);
25breakOn(MultiParamLoader::OnError + MultiParamLoader::AfterObject);
26}
27
28MiniGenotype* MiniGenotypeLoader::loadNextGenotype()
29{
30genotype_object.clear();
31if ((go()==AfterObject)&&(getClass()==&genotype_param))
32        return &genotype_object;
33else
34        return 0;
35}
Note: See TracBrowser for help on using the repository browser.