FSO.SimAntics.VM.GetObjectById C# (CSharp) Method

GetObjectById() public method

Gets an entity from this VM.
public GetObjectById ( short id ) : FSO.SimAntics.VMEntity
id short The entity's ID.
return FSO.SimAntics.VMEntity
        public VMEntity GetObjectById(short id)
        {
            if (ObjectsById.ContainsKey(id))
            {
                return ObjectsById[id];
            }
            return null;
        }

Usage Example

Ejemplo n.º 1
0
        public bool CheckWallValid(LotTilePos pos, WallTile wall)
        {
            if (pos.Level < 1 || pos.Level > ObjectsAt.Count || !ObjectsAt[pos.Level - 1].ContainsKey(pos.TileID))
            {
                return(true);
            }
            var objs = ObjectsAt[pos.Level - 1][pos.TileID];

            foreach (var id in objs)
            {
                var obj = VM.GetObjectById(id);
                if (obj.WallChangeValid(wall, obj.Direction, false) != VMPlacementError.Success)
                {
                    return(false);
                }
            }
            return(true);
        }
All Usage Examples Of FSO.SimAntics.VM::GetObjectById