Beispiel #1
0
 internal override async Task AttachEntityAsync(IAttachArgs e)
 {
     if (IsOpen)
     {
         await base.AttachEntityAsync(e);
     }
     else
     {
         e.Seal();
     }
 }
Beispiel #2
0
        internal override Task AttachEntityAsync(IAttachArgs e)
        {
            if (IsExtended && e.CurrentMove.Entity is PistonEntity)
            {
                e.Result = new PistonTile(TriggerPosition, Direction, false);
            }
            else
            {
                e.Seal();
            }

            return Task.CompletedTask;
        }
Beispiel #3
0
 internal override async Task AttachEntityAsync(IAttachArgs e)
 {
     if (e.CurrentMove.Entity is PlayerEntity)
     {
         // Players may walk over pins, use default behavior
         await base.AttachEntityAsync(e);
     }
     else if ((e.CurrentMove.Entity as BalloonEntity)?.Color == Color)
     {
         // Balloons that match the pin's color are allowed
         e.Result = Compose(this, e.CurrentMove.Entity);
     }
     else
     {
         // All other entities are rejected
         e.Seal();
     }
 }
Beispiel #4
0
        internal override async Task AttachEntityAsync(IAttachArgs e)
        {
            var inDirection = e.CurrentMove.Offset;
            var outDirection = _outDirections.TryGetValue(new Tuple<Point, Point>(Orientation, inDirection));

            if (outDirection.IsDirection)
            {
                if (Entity != Entity.None)
                    await Entity.DetachAsync(e.CreateEntityDetachArgs(this, outDirection));

                if (!e.IsSealed)
                    e.Result = Compose(this, e.CurrentMove.Entity);
            }
            else
            {
                // The entity tries to move across a wall side of the corner
                e.Seal();
            }
        }
Beispiel #5
0
 internal override Task AttachEntityAsync(IAttachArgs e)
 {
     e.Seal();
     return Task.CompletedTask;
 }