Exemple #1
0
 private void checkIfDepleted(IVoxelHandle handle)
 {
     if (handle.Data.DataValue >= maxDataVal && handle.Data.Inventory.ItemCount == 0)
     {
         handle.ChangeType(Hole);
     }
 }
Exemple #2
0
 public override void Tick(IVoxelHandle handle)
 {
     if (handle.GetInternalVoxel().GetPart <Ore>().IsDepleted())
     {
         handle.ChangeType(Land);
     }
 }
Exemple #3
0
 private void checkComplete(IVoxelHandle handle)
 {
     if (neededResources.All(e => e.Amount == handle.Data.Inventory.GetAmountOfType(e.Type)))
     {
         handle.ChangeType(building);
     }
 }
Exemple #4
0
        public void CureInfestation(IVoxelHandle v)
        {
            if (v.Type != Infestation)
            {
                throw new InvalidOperationException();
            }

            var data = v.Data.Infestation;

            v.ChangeType(data.OriginalType ?? Land);
            v.Data.DataValue = data.OriginalDataValue;

            v.Data.MagicLevel = 10;
        }
Exemple #5
0
        public void InfestVoxel(IVoxelHandle target)
        {
            if (target.Type == Monument)
            {
                return;
            }
            var data = new InfestationData()
            {
                OriginalType      = target.Type,
                OriginalDataValue = target.Data.DataValue
            };

            target.ChangeType(Infestation);
            target.Data.Infestation = data;
        }
 public override void OnRightClick(PlayerState player, IVoxelHandle voxel)
 {
     voxel.ChangeType(land);
 }
 public override void OnLeftClick(PlayerState player, IVoxelHandle voxel)
 {
     voxel.ChangeType(air);
 }