source: cpp/gdk/syntparam.cpp @ 5

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

added the GDK (Genotype Development Kit)

File size: 1.0 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 "nonstd.h"
6#include "syntparam.h"
7#include "paramobj.h"
8#include <math.h>
9
10SyntParam::SyntParam(ParamEntry *init_pe,SString* autostr)
11        :autostring(autostr)
12{
13Param::setParamTab(init_pe);
14pe=ParamObject::makeParamTab(this);
15Param::setParamTab(pe);
16obj=ParamObject::makeObject(pe);
17Param::select(obj);
18Param::setDefault();
19revert();
20}
21
22SyntParam::SyntParam(const SyntParam& src)
23        :autostring(src.autostring)
24{
25Param::setParamTab(src.pe);
26pe=ParamObject::makeParamTab(this);
27Param::setParamTab(pe);
28obj=ParamObject::dupObject(src.obj);
29Param::select(obj);
30}
31
32SyntParam::~SyntParam()
33{
34update();
35ParamObject::freeParamTab(pe);
36ParamObject::freeObject(obj);
37}
38
39void SyntParam::update(SString *s)
40{
41if (!s) s=autostring;
42if (s) {*s=""; Param::save2(*s,0,0);}
43}
44
45void SyntParam::revert(SString *s)
46{
47if (!s) s=autostring;
48if (s)  {
49        int p=0;
50        Param::load2(*s,p);
51        }
52}
53
54
55
56
57
Note: See TracBrowser for help on using the repository browser.