00001 //#include <stdio.h> 00002 00003 #include "Gun.h" 00004 00005 00006 00007 00008 Gun::Gun(Robot& r) : RobotObject(r) 00009 { 00010 } 00011 00012 00013 Gun::~Gun() 00014 { 00015 } 00016 00017 00018 void Gun::Tick(long usec) 00019 { 00020 RobotObject::Tick(usec); // repair 00021 00022 } 00023 00024 00025 long Gun::get_property(int prop) 00026 { 00027 switch (prop) 00028 { 00029 case 1: // ok 00030 return Ok(); 00031 case 2: // damage 00032 return GetDamage(); 00033 case 3: // repair_rate 00034 return GetRepairRate(); 00035 } 00036 return 0; 00037 } 00038 00039 00040 void Gun::set_property(int prop,long value) 00041 { 00042 switch (prop) 00043 { 00044 case 3: 00045 SetRepairRate(value); 00046 break; 00047 } 00048 } 00049 00050 00051 long Gun::call_method(int method,stack_v&) 00052 { 00053 } 00054 00055