예제 #1
0
        public Migration(BlockBeliefs dest)
        {
            _creationTime = MainWindow.Time;
            _destBeliefs = dest;

            Destination = dest.Block;
        }
예제 #2
0
        public Barricading(Desires.Barricading desire, Beliefs beliefs, BlockBeliefs blockBeliefs)
            : base(desire, beliefs)
        {
            _blockBeliefs = blockBeliefs;

            _destTiles = new List<Tile>();

            var block = _blockBeliefs.Block;

            var dirs = new[] {
                Face.North,
                Face.East,
                Face.South,
                Face.West
            };

            for (int x = 1; x < block.Width - 1; ++x) {
                for (int y = 1; y < block.Height - 1; ++y) {
                    var tile = block[block.X + x, block.Y + y];

                    if (tile.IsInterior) continue;

                    foreach (var dir in dirs) {
                        if (tile.IsWallSolid(dir)) continue;

                        var n = dir.GetNormal();

                        int xn = x + (int) n.X, yn = y + (int) n.Y;
                        var neighbour = block[block.X + xn, block.Y + yn];

                        if (neighbour.IsInterior) {
                            _destTiles.Add(tile);
                            break;
                        }
                    }
                }
            }

            _pendingTiles = _destTiles.Where(x => x.StaticEntities.Count() == 0).ToArray();
        }
예제 #3
0
 public Barricading(BlockBeliefs block)
 {
     _blockBeliefs = block;
     _createdTime = MainWindow.Time;
 }