Last change
on this file since 56 was
5,
checked in by sz, 16 years ago
|
added the GDK (Genotype Development Kit)
|
File size:
1.0 KB
|
Rev | Line | |
---|
[5] | 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 | |
---|
| 10 | SyntParam::SyntParam(ParamEntry *init_pe,SString* autostr) |
---|
| 11 | :autostring(autostr) |
---|
| 12 | { |
---|
| 13 | Param::setParamTab(init_pe); |
---|
| 14 | pe=ParamObject::makeParamTab(this); |
---|
| 15 | Param::setParamTab(pe); |
---|
| 16 | obj=ParamObject::makeObject(pe); |
---|
| 17 | Param::select(obj); |
---|
| 18 | Param::setDefault(); |
---|
| 19 | revert(); |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | SyntParam::SyntParam(const SyntParam& src) |
---|
| 23 | :autostring(src.autostring) |
---|
| 24 | { |
---|
| 25 | Param::setParamTab(src.pe); |
---|
| 26 | pe=ParamObject::makeParamTab(this); |
---|
| 27 | Param::setParamTab(pe); |
---|
| 28 | obj=ParamObject::dupObject(src.obj); |
---|
| 29 | Param::select(obj); |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | SyntParam::~SyntParam() |
---|
| 33 | { |
---|
| 34 | update(); |
---|
| 35 | ParamObject::freeParamTab(pe); |
---|
| 36 | ParamObject::freeObject(obj); |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | void SyntParam::update(SString *s) |
---|
| 40 | { |
---|
| 41 | if (!s) s=autostring; |
---|
| 42 | if (s) {*s=""; Param::save2(*s,0,0);} |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | void SyntParam::revert(SString *s) |
---|
| 46 | { |
---|
| 47 | if (!s) s=autostring; |
---|
| 48 | if (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.