source: cpp/frams/_demos/genotypeloader.cpp @ 286

Last change on this file since 286 was 286, checked in by Maciej Komosinski, 9 years ago

Updated headers

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
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{
24addObject(&genotype_param);
25breakOn(MultiParamLoader::OnError + MultiParamLoader::AfterObject);
26}
27
28MiniGenotype* MiniGenotypeLoader::loadNextGenotype()
29{
30genotype_object.clear();
31if ((go()==AfterObject)&&(getObject().matchesInterfaceName(&genotype_param)))
32        return &genotype_object;
33else
34        return 0;
35}
Note: See TracBrowser for help on using the repository browser.