Пример #1
0
 private IEnumerable <IVoxelHandle> getWareHousesInRange(IVoxelHandle handle, int range)
 {
     return(handle.GetRange(range).Where(v => v.Type is WarehouseType));
 }
Пример #2
0
 private bool hasWaterNeighbour(IVoxelHandle handle)
 {
     return(handle.Get4Connected().Any(e => checkIsAccesibleWater(handle, e)));
 }
Пример #3
0
        private int countResourcesIncludingKanban(ItemType type, IVoxelHandle handle)
        {
            var inventory = handle.Data.Inventory;

            return(inventory.GetAmountOfType(type) + inventory.GetAmountOfType(typesFactory.GetIncomingKanban(type)) + inventory.GetAmountOfType(typesFactory.GetOutgoingKanban(type)));
        }
Пример #4
0
 public void SendMonumentRangeInput(IVoxelHandle monumentVoxel, int value)
 {
     pendingMonumentInputs.Add(new NumberInput(monumentVoxel.GetInternalVoxel().Coord, value));
 }
Пример #5
0
 private bool checkIsAccesibleWater(IVoxelHandle currentHandle, IVoxelHandle handleToCheck)
 {
     return(handleToCheck.Type is WaterType &&
            Math.Abs(Math.Abs(handleToCheck.Data.Height - currentHandle.Data.Height) - 0f) < 0.001f);
 }
Пример #6
0
 public float DistanceTo(IVoxelHandle handle)
 {
     return(handle.GetInternalVoxel().GetOffset(handle.GetInternalVoxel()).GetLength());
 }
Пример #7
0
 public bool CanAcceptItemType(IVoxelHandle deliveryHandle, ItemType type)
 {
     return(Type.CanAcceptItemType(this, deliveryHandle, type));
 }
Пример #8
0
 public override void OnTargetChanged(PlayerState player, IVoxelHandle voxel, TWKeyboard keyboard, TWMouse mouse)
 {
     getTool(player).OnTargetChanged(voxel, keyboard, mouse);
 }
Пример #9
0
 public override void OnKeypress(PlayerState player, IVoxelHandle voxel, Key key)
 {
     getTool(player).OnKeypress(voxel, key);
 }
Пример #10
0
 public override void OnRightClick(PlayerState player, IVoxelHandle voxel)
 {
     getTool(player).OnRightClick(voxel);
 }