Esempio n. 1
0
        public override SceneState Apply(SceneState sceneState)
        {
            var bot          = sceneState.Bots.First();
            var vectorToFill = Vector3D.FromPoint(bot.Current) + Nd;
            var pointToFill  = vectorToFill.ToPoint();

            if (sceneState.Matrix[pointToFill] == VoxelStatus.Full)
            {
                sceneState.Matrix[pointToFill] = VoxelStatus.Empty;
                return(sceneState.ChangeEnergy(-12));
            }
            else
            {
                return(sceneState.ChangeEnergy(3));
            }
        }
Esempio n. 2
0
        public override SceneState Apply(SceneState sceneState)
        {
            var bot          = sceneState.Bots.First();
            var vectorToMove = Vector3D.FromPoint(bot.Current) + LongDiff;
            var pointToMove  = vectorToMove.ToPoint();

            bot.MoveTo(pointToMove);

            return(sceneState.ChangeEnergy(2 * LongDiff.ManhattanLength));
        }