VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
realResource.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vlutil/vlMachineTypes.h>
9 #include <readerWriter/rwReal.h>
10 #include "vrfutil/simResource.h"
11 
12 
13 
18 #include "vrfutil/vrfutilDefines.h"
20 {
21 
22 public:
23 
26 
31  DtRealResource(const DtString& resourceName, DtReaderWriterRegistry*
32  parentRegistry = 0);
33 
36  parentRegistry = 0);
37 
40 
41 public:
43  virtual ~DtRealResource();
44 
46  virtual void updateAmountFromChildren();
47 
50  virtual void updateFullAmountFromChildren();
51 
53  virtual DtSimResource * clone(DtReaderWriterRegistry* parentRegistry = 0)
54  const;
55 
57  virtual DtString type() const;
58 
60  virtual void distributeAmountToChildren();
61 
64  virtual void distributeFullAmountToChildren();
65 
68  virtual void setAmount(DtReal amount);
69  virtual DtReal amount() const;
70 
72  virtual void deplete(DtReal amount);
73 
76  virtual void replenish(DtReal amount);
77 
78  virtual void setFullAmount(DtReal fullAmount);
79  virtual DtReal fullAmount() const;
80 
81  virtual DtReal percentageFull() const;
82  virtual void setPercentageFull(DtReal percent);
83 
84 
87  virtual DtReal constrainAmount(DtReal amount) const;
88 
89  static DtSimResource * creator();
90 
93  virtual bool isEqual(const DtSimResource& res) const;
94 
96  virtual void merge(const DtSimResource*);
97 
98 protected:
99 
102 
103 };
virtual void setPercentageFull(DtReal percent)=0
Percent will be truncated to be between 0. and 1.
DtRwReal myFullAmount
Definition: realResource.h:101
virtual DtReal percentageFull() const =0
The deriving class will also provide a function to specify the quantity (of the appropriate type) tha...
virtual DtString type() const =0
The data type of the resource. These types are defined in rsrcTypes.h.
virtual void merge(const DtSimResource *)
DtRealResource implements the required functions for a resource that can be measured by a real...
Definition: realResource.h:19
Definition: readerWriterRegistry.h:39
virtual void updateFullAmountFromChildren()=0
When the deriving class&#39;s setFullAmount is called, this should be called on the resources parent...
DtSimResource & operator=(const DtSimResource &orig)
assignment operator
virtual void distributeFullAmountToChildren()=0
When the deriving class&#39;s setFullAmount is called, this should be called if the resource has any chil...
virtual void distributeAmountToChildren()=0
When the deriving class&#39;s setAmount is called, this should be called if the resource has any children...
virtual bool isEqual(const DtSimResource &res) const
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
virtual DtSimResource * clone(DtReaderWriterRegistry *parentRegistry=0) const =0
DtSimResource is an abstract base class that can be used to create a hierarchical resource list of a ...
Definition: simResource.h:41
DtRwReal myAmount
Definition: realResource.h:100
virtual void updateAmountFromChildren()=0
When the deriving class&#39;s setAmount is called, this should be called on the resources parent...
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)