1 /* bzflag 2 * Copyright (c) 1993-2021 Tim Riker 3 * 4 * This package is free software; you can redistribute it and/or 5 * modify it under the terms of the license found in the file 6 * named COPYING that should have accompanied this file. 7 * 8 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11 */ 12 13 #ifndef BZF_OBSTACLE_MODIFIER_H 14 #define BZF_OBSTACLE_MODIFIER_H 15 16 // common headers 17 #include "BzMaterial.h" 18 19 class Obstacle; 20 class GroupInstance; 21 22 23 class ObstacleModifier 24 { 25 public: 26 ObstacleModifier(); 27 ObstacleModifier(const ObstacleModifier& obsMod, 28 const GroupInstance& grpinst); 29 ~ObstacleModifier(); 30 void init(); 31 32 void execute(Obstacle* obstacle) const; 33 34 void getMaterialMap(const MaterialSet& matSet, MaterialMap& matMap) const; 35 36 private: 37 bool modifyTeam; // only for bases 38 int team; 39 bool modifyColor; // modify by tinting 40 float tint[4]; 41 bool modifyPhysicsDriver; // only replaces valid physics drivers 42 int phydrv; 43 bool modifyMaterial; // swaps the whole thing 44 const BzMaterial* material; 45 MaterialMap matMap; 46 47 bool driveThrough; 48 bool shootThrough; 49 bool ricochet; 50 }; 51 52 53 #endif // BZF_OBSTACLE_MODIFIER_H 54 55 // Local Variables: *** 56 // mode: C++ *** 57 // tab-width: 4 *** 58 // c-basic-offset: 4 *** 59 // indent-tabs-mode: nil *** 60 // End: *** 61 // ex: shiftwidth=4 tabstop=4 62