mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:26:40 +00:00 
			
		
		
		
	Issue #324: Modified the interface for modified stats
This commit is contained in:
		
							parent
							
								
									fe86ce5a2c
								
							
						
					
					
						commit
						25a5657d80
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
					@ -31,6 +31,11 @@ namespace MWMechanics
 | 
				
			||||||
                return mModified;
 | 
					                return mModified;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            T getModifier() const
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return mModified-mBase;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /// Set base and modified to \a value.
 | 
					            /// Set base and modified to \a value.
 | 
				
			||||||
            void set (const T& value)
 | 
					            void set (const T& value)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -65,10 +70,9 @@ namespace MWMechanics
 | 
				
			||||||
                mBase += diff;
 | 
					                mBase += diff;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /// Change modified relatively.
 | 
					            void setModifier (const T& modifier)
 | 
				
			||||||
            void modify (const T& diff)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                mModified += diff;
 | 
					                mModified = mBase + modifier;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue