You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
688 B
21 lines
688 B
9 years ago
|
#include "object.h"
|
||
|
|
||
9 years ago
|
ObjectBase* Arifm_Add(const ObjectList* input);
|
||
|
ObjectBase* Arifm_Sub(const ObjectList* input);
|
||
|
ObjectBase* Arifm_Mul(const ObjectList* input);
|
||
|
ObjectBase* Arifm_Div(const ObjectList* input);
|
||
|
ObjectBase* Arifm_Pow(const ObjectList* input);
|
||
|
ObjectBase* Arifm_Neg(const ObjectList* input);
|
||
|
ObjectBase* Arifm_Pos(const ObjectList* input);
|
||
9 years ago
|
|
||
|
template<class T>
|
||
9 years ago
|
ObjectBase* Get(const ObjectList* input)
|
||
9 years ago
|
{
|
||
|
if(input->Size()!=2) return 0;
|
||
|
const ObjectBase* ob=input->At(0);
|
||
|
const ObjectBase* name=input->At(1);
|
||
|
if( (!IS_OTYPE(ob,T)) || (!IS_OTYPE(name,ObjectString)) ) return 0;
|
||
|
|
||
|
return dynamic_cast<const T*>(ob)->Get(dynamic_cast<const ObjectString*>(name)->Value());
|
||
|
}
|