Is() public method

Returns true if entity is of the given data type.
public Is ( DataType type ) : bool
type DataType
return bool
Exemplo n.º 1
0
        /// <summary>
        /// Broadcasts EntityAppears|ItemAppears|PropAppears in entity's region.
        /// </summary>
        /// <param name="entity"></param>
        public static void EntityAppears(Entity entity)
        {
            var op = Op.EntityAppears;
            if (entity.Is(EntityType.Item))
                op = Op.ItemAppears;
            else if (entity.Is(EntityType.Prop))
                op = Op.PropAppears;

            var packet = new Packet(op, MabiId.Broadcast);
            packet.AddPublicEntityInfo(entity);

            entity.Region.Broadcast(packet, entity, false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Broadcasts EntityDisappears|ItemDisappears in entity's region.
        /// </summary>
        /// <param name="entity"></param>
        public static void EntityDisappears(Entity entity)
        {
            var op = Op.EntityDisappears;
            if (entity.Is(EntityType.Item))
                op = Op.ItemDisappears;

            var packet = new Packet(op, MabiId.Broadcast);
            packet.PutLong(entity.EntityId);
            packet.PutByte(0);

            entity.Region.Broadcast(packet, entity, false);
        }