Esempio n. 1
0
        public override void Update(DwarfTime time, VoxelSelector voxSelector, BodySelector bodySelector)
        {
            SelectionTimer.Update(time);
            if (SelectionTimer.HasTriggered)
            {
                if (Type == InspectType.InspectEntity)
                {
                    MouseState  mouse    = Mouse.GetState();
                    List <Body> selected = bodySelector.SelectBodies(new Rectangle(mouse.X - 10, mouse.Y - 10, 20, 20));

                    if (selected.Count > 0)
                    {
                        OnEntitiesSelected(PlayState.Master.Spells, selected);
                    }
                }
                else
                {
                    Voxel vox = new Voxel();
                    PlayState.ChunkManager.ChunkData.GetNonNullVoxelAtWorldLocation(PlayState.CursorLightPos, ref vox);

                    OnVoxelsSelected(PlayState.Master.Spells, new List <Voxel>()
                    {
                        vox
                    });
                }
            }
            base.Update(time, voxSelector, bodySelector);
        }
Esempio n. 2
0
        public override void Update(DwarfTime time, VoxelSelector voxSelector, BodySelector bodySelector)
        {
            SelectionTimer.Update(time);
            if (SelectionTimer.HasTriggered)
            {
                if (Type == InspectType.InspectEntity)
                {
                    MouseState  mouse    = Mouse.GetState();
                    List <Body> selected = bodySelector.SelectBodies(new Rectangle(mouse.X - 10, mouse.Y - 10, 20, 20));

                    if (selected.Count > 0)
                    {
                        OnEntitiesSelected(World.Master.Spells, selected);
                    }
                }
                else
                {
                    var vox = new VoxelHandle(World.ChunkManager.ChunkData,
                                              GlobalVoxelCoordinate.FromVector3(World.CursorLightPos));
                    if (vox.IsValid)
                    {
                        OnVoxelsSelected(World.Master.Spells, new List <VoxelHandle>()
                        {
                            vox
                        });
                    }
                }
            }
            base.Update(time, voxSelector, bodySelector);
        }
Esempio n. 3
0
        public override void Update(DwarfTime time, VoxelSelector voxSelector, BodySelector bodySelector)
        {
            SelectionTimer.Update(time);
            if (SelectionTimer.HasTriggered)
            {
                if (Type == InspectType.InspectEntity)
                {
                    MouseState mouse = Mouse.GetState();
                    List<Body> selected = bodySelector.SelectBodies(new Rectangle(mouse.X - 10, mouse.Y - 10, 20, 20));

                    if (selected.Count > 0)
                    {
                        OnEntitiesSelected(PlayState.Master.Spells, selected);
                    }
                }
                else
                {
                    Voxel vox = new Voxel();
                    PlayState.ChunkManager.ChunkData.GetNonNullVoxelAtWorldLocation(PlayState.CursorLightPos, ref vox);

                    OnVoxelsSelected(PlayState.Master.Spells, new List<Voxel>(){vox});
                }
            }
            base.Update(time, voxSelector, bodySelector);
        }