~ubuntu-branches/ubuntu/oneiric/blobandconquer/oneiric

« back to all changes in this revision

Viewing changes to src/cplusplus/CStructure.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Guus Sliepen
  • Date: 2008-06-15 12:04:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080615120429-5ss7cbb4z9mpywj5
Tags: 0.95-1
New upstream release. Closes: #486310

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright (C) 2006 Parallel Realities
 
3
 
 
4
This program is free software; you can redistribute it and/or
 
5
modify it under the terms of the GNU General Public License
 
6
as published by the Free Software Foundation; either version 2
 
7
of the License, or (at your option) any later version.
 
8
 
 
9
This program is distributed in the hope that it will be useful,
 
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
12
 
 
13
See the GNU General Public License for more details.
 
14
 
 
15
You should have received a copy of the GNU General Public License
 
16
along with this program; if not, write to the Free Software
 
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
18
 
 
19
*/
 
20
 
 
21
#include "../headers.h"
 
22
 
 
23
Structure::Structure()
 
24
{
 
25
        boundingBox.mins.set(0, 0, 0);
 
26
        boundingBox.maxs.set(0, 0, 0);
 
27
        
 
28
        flags = EF_IMMORTAL+EF_NOCLIP+EF_WEIGHTLESS;
 
29
        
 
30
        speed = 0.5;
 
31
        
 
32
        active = true;
 
33
        
 
34
        hint = true;
 
35
        
 
36
        currentItem = NULL;
 
37
        
 
38
        isMissionTarget = false;
 
39
}
 
40
 
 
41
Structure::~Structure()
 
42
{
 
43
}
 
44
 
 
45
void Structure::loadAdditional(Properties *props)
 
46
{
 
47
        state = props->getInt("state", state);
 
48
        speed = props->getFloat("speed", speed);
 
49
        active = props->getInt("active", active);
 
50
        startPosition = props->getVector("startPosition", startPosition);
 
51
        endPosition = props->getVector("endPosition", endPosition);
 
52
        MDLModelName = props->getString("model", MDLModelName.getText());
 
53
        hint = props->getInt("hint", hint);
 
54
        isMissionTarget = props->getInt("isMissionTarget", isMissionTarget);
 
55
}
 
56
 
 
57
void Structure::saveAdditional(Properties *props)
 
58
{
 
59
        props->setProperty("state", state);
 
60
        props->setProperty("speed", speed);
 
61
        props->setProperty("active", active);
 
62
        props->setProperty("startPosition", startPosition.toString());
 
63
        props->setProperty("endPosition", endPosition.toString());
 
64
        props->setProperty("model", MDLModelName.getText());
 
65
        props->setProperty("hint", hint);
 
66
        props->setProperty("isMissionTarget", isMissionTarget);
 
67
}