mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 22:36:58 +00:00
21 lines
725 B
TypeScript
21 lines
725 B
TypeScript
import { GetRoomEngine, GetSessionDataManager, IFurnitureData, RoomObjectCategory, RoomObjectVariable } from '@nitrots/nitro-renderer';
|
|
|
|
export function GetFurnitureDataForRoomObject(roomId: number, objectId: number, category: number): IFurnitureData
|
|
{
|
|
const roomObject = GetRoomEngine().getRoomObject(roomId, objectId, category);
|
|
|
|
if(!roomObject) return;
|
|
|
|
const typeId = roomObject.model.getValue<number>(RoomObjectVariable.FURNITURE_TYPE_ID);
|
|
|
|
switch(category)
|
|
{
|
|
case RoomObjectCategory.FLOOR:
|
|
return GetSessionDataManager().getFloorItemData(typeId);
|
|
case RoomObjectCategory.WALL:
|
|
return GetSessionDataManager().getWallItemData(typeId);
|
|
}
|
|
|
|
return null;
|
|
}
|