Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
edgeimpl.hpp
1 //////////////////////////////
2 //
3 // File: swrs/edgeimpl.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Feb 16 2013
9 // This file is part of Project Labyrinth
10 // This file is going to be released under terms of GNU GPL in near future
11 //
12 //////////////////////////////
13 
14 #ifndef __EDGE_IMPL_H__
15 #define __EDGE_IMPL_H__
16 #include <string>
17 #include <vector>
18 #include "swrs/feature.hpp"
19 #include "swrs/featureimpl.hpp"
20 namespace SWRS
21 {
22  //! implementation of edge
23  class EdgeImpl: public FeatureImpl
24  {
25  //std::string req_traits;
26  protected:
27  //! type def: vector of required traits and their minimum levels
28  typedef std::vector< std::pair < std::string, int > > RequiredTraitsVector;
29  //! instance of RequiredTraitsVector
31  //! if other edges are required to get this edge (i.e. it is an advanced edge)
33  //! instance of RequiredEdgesVector
35  std::string VerbalizeLevel(int lev)const ;
36  public:
37  //! if any trait is required to get this particular edge, set it
38  void SetRequiredTrait(const std::string & traitname,
39  const std::string & traitlevel);
40  //! for UI
41  const std::string GetRequirementsAsString() const;
42  //! if an edge (i.e. lower level one) is required
43  void SetRequiredEdge(const std::string & edgename);
44  std::pair<bool,std::string> DoesCharacterMeetRequirements(const ICharacter & c)const;
45  };
46 }
47 #endif
48