SESubstanceManager.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 class SESubstance;
7 
8 class CDM_DECL SESubstanceManager : public Loggable
9 {
10 public:
11  SESubstanceManager(Logger* logger);
12  virtual ~SESubstanceManager();
13 
14  virtual void Clear();
15  virtual void Reset();
16  virtual bool LoadSubstanceDirectory(const std::string& data_dir=".");
17 
18  virtual const std::vector<SESubstance*>& GetSubstances() const;
19  virtual SESubstance* GetSubstance(const std::string& name) const;
20  virtual void AddSubstance(SESubstance& substance);
21 
22  virtual bool IsActive(const SESubstance& substance) const;
23  virtual const std::vector<SESubstance*>& GetActiveSubstances() const;
24  virtual void AddActiveSubstance(SESubstance& substance);
25  virtual void RemoveActiveSubstance(const SESubstance& substance);
26  virtual void RemoveActiveSubstances(const std::vector<SESubstance*>& substances);
27  virtual void RemoveActiveSubstances();
28 
29  virtual const std::vector<SESubstance*>& GetActiveGases() const;
30  virtual const std::vector<SESubstance*>& GetActiveLiquids() const;
31 
32  virtual const std::vector<SESubstanceCompound*>& GetCompounds() const;
33  virtual SESubstanceCompound* GetCompound(const std::string& name) const;
34  virtual void AddCompound(SESubstanceCompound& compound);
35 
36  virtual bool IsActive(const SESubstanceCompound& compound) const;
37  virtual const std::vector<SESubstanceCompound*>& GetActiveCompounds() const;
38  virtual void AddActiveCompound(SESubstanceCompound& compound);
39  virtual void RemoveActiveCompound(SESubstanceCompound& compound);
40  virtual void RemoveActiveCompounds(const std::vector<SESubstanceCompound*>& compounds);
41 
42 protected:
43 
44  // I am making all these vectors of SESubstances,
45  // Usually these are passed to methods that take a
46  // vector of substances, and a vector of drugs won't be accepted
47  // I could do some crazy template methods that will auto convert
48  // these to substance vectors, but I think that would be too
49  // slow for the amount of times we call stuff
50  // So for now, these will just be substance vectors
51  // If we want drug vectors, I can rename methods to
52  // std::vector<SESubstance*>* GetActiveDrugSubstances
53  // std::vector<SEDrug*>* GetActiveDrugs()
54  // But I don't see a need for that yet...
55  // So will just leave it as it now
56 
57  std::vector<SESubstance*> m_Substances;
58  std::vector<SESubstance*> m_ActiveSubstances;
59  std::vector<SESubstance*> m_ActiveGases;
60  std::vector<SESubstance*> m_ActiveLiquids;
61 
62  std::vector<SESubstanceCompound*> m_Compounds;
63  std::vector<SESubstanceCompound*> m_ActiveCompounds;
64 
65 private:
66  std::map<SESubstance*, std::string> m_OriginalSubstanceData;
67  std::map<SESubstanceCompound*, std::string> m_OriginalCompoundData;
68 
69 };
std::vector< SESubstanceCompound * > m_Compounds
Definition: SESubstanceManager.h:62
std::map< SESubstanceCompound *, std::string > m_OriginalCompoundData
Definition: SESubstanceManager.h:67
Definition: SESubstanceManager.h:8
std::vector< SESubstance * > m_ActiveSubstances
Definition: SESubstanceManager.h:58
Definition: Logger.h:61
std::vector< SESubstance * > m_ActiveLiquids
Definition: SESubstanceManager.h:60
Definition: Logger.h:11
std::map< SESubstance *, std::string > m_OriginalSubstanceData
Definition: SESubstanceManager.h:66
Definition: SESubstanceCompound.h:9
std::vector< SESubstanceCompound * > m_ActiveCompounds
Definition: SESubstanceManager.h:63
std::vector< SESubstance * > m_ActiveGases
Definition: SESubstanceManager.h:59
Definition: SESubstance.h:14
std::vector< SESubstance * > m_Substances
Definition: SESubstanceManager.h:57