Skip to content

Commit

Permalink
feat(client): add InteriorPortal entityCount (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxshady authored Nov 17, 2024
1 parent 8bb66e7 commit 48c4f71
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/src/bindings/InteriorPortal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ static void GetCornerPos(const v8::FunctionCallbackInfo<v8::Value>& info)
}


static void EntityCountGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
GET_THIS_INTERIOR_PORTAL(portal);

V8_RETURN_UINT(portal->GetEntityCount());
}

static void SetCornerPos(const v8::FunctionCallbackInfo<v8::Value>& info)
{
GET_THIS_INTERIOR_PORTAL(portal);
Expand All @@ -165,6 +172,7 @@ extern V8Class v8InteriorPortal("InteriorPortal",
V8Helpers::SetAccessor(isolate, tpl, "roomFrom", &RoomFromGetter, &RoomFromSetter);
V8Helpers::SetAccessor(isolate, tpl, "roomTo", &RoomToGetter, &RoomToSetter);
V8Helpers::SetAccessor(isolate, tpl, "flag", &FlagGetter, &FlagSetter);
V8Helpers::SetAccessor(isolate, tpl, "entityCount", &EntityCountGetter);

V8Helpers::SetMethod(isolate, tpl, "getCornerPos", &GetCornerPos);
V8Helpers::SetMethod(isolate, tpl, "getEntityArchetype", &GetEntityArchetype);
Expand Down

0 comments on commit 48c4f71

Please sign in to comment.