Пример #1
0
 public TileCoord(GameEntity entity, Point coord, Point size, TileSystemComponent tileSystem)
     : base(entity)
 {
     tileSystem_ = tileSystem;
     coord_      = coord;
     size_       = size;
 }
Пример #2
0
 public TileCoord(GameEntity entity, Point coord, Point size, TileSystemComponent tileSystem)
     : base(entity)
 {
     tileSystem_ = tileSystem;
     coord_ = coord;
     size_ = size;
 }
Пример #3
0
        public TileArea(TileSystemComponent parent, Point size, Point offset)
        {
            parent_ = parent;
            size_   = size;
            offset_ = offset;

            tiles_ = new TileStatus[size_.X, size_.Y];
        }
Пример #4
0
        public TileArea(TileSystemComponent parent, Point size, Point offset)
        {
            parent_ = parent;
            size_ = size;
            offset_ = offset;

            tiles_ = new TileStatus[size_.X, size_.Y];
        }
Пример #5
0
        public override Component deepCopy(GameEntity entity)
        {
            TileSystemComponent c = new TileSystemComponent(entity);

            foreach (TileArea area in areas_)
            {
                c.areas_.Add(area.deepCopy(c));
            }
            return(c);
        }
Пример #6
0
 public GameEntity pick(TileSystemComponent tsc, Point point)
 {
     foreach (TileCoord tile in tiles_)
     {
         if (tile.tileSystem_ == tsc)
         {
             if (tile.isWithin(point))
             {
                 return tile.entity_;
             }
         }
     }
     return null;
 }
Пример #7
0
        private Ship(GameEntity world)
        {
            entity_ = new GameEntity();
            entity_.spatial = new Components.SpatialComponent(entity_, world.spatial);
            entity_.physic = new PhysicsComponent(entity_, Vector2.Zero, 0, Vector2.Zero);

            Locator.getComponentManager().addEntity(entity_);

            tiles = new Components.TileSystemComponent(entity_);
            tiles.addArea(new Point(16, 8), Point.Zero);
            tiles.addArea(new Point(16, 8), new Point(0, 10));
            tiles.addArea(new Point(16, 8), new Point(0, 20));
            tiles.addArea(new Point(6, 28), new Point(16, 0));
            tiles.addArea(new Point(10, 16), new Point(22, 6));
            tiles.addArea(new Point(10, 8), new Point(32, 10));
            tiles.addArea(new Point(6, 16), new Point(42, 6));

            tiles.generateTileEntities(entity_);
        }
Пример #8
0
        private Ship(GameEntity world)
        {
            entity_         = new GameEntity();
            entity_.spatial = new Components.SpatialComponent(entity_, world.spatial);
            entity_.physic  = new PhysicsComponent(entity_, Vector2.Zero, 0, Vector2.Zero);

            Locator.getComponentManager().addEntity(entity_);

            tiles = new Components.TileSystemComponent(entity_);
            tiles.addArea(new Point(16, 8), Point.Zero);
            tiles.addArea(new Point(16, 8), new Point(0, 10));
            tiles.addArea(new Point(16, 8), new Point(0, 20));
            tiles.addArea(new Point(6, 28), new Point(16, 0));
            tiles.addArea(new Point(10, 16), new Point(22, 6));
            tiles.addArea(new Point(10, 8), new Point(32, 10));
            tiles.addArea(new Point(6, 16), new Point(42, 6));

            tiles.generateTileEntities(entity_);
        }
Пример #9
0
 public TileArea deepCopy(TileSystemComponent parent)
 {
     return(new TileArea(parent, size_, offset_));
 }
Пример #10
0
 public TileArea deepCopy(TileSystemComponent parent)
 {
     return new TileArea(parent, size_, offset_);
 }