invertika_game.Game.Actor.setPosition C# (CSharp) Method

setPosition() public method

public setPosition ( Point p ) : void
p Point
return void
        public void setPosition(Point p)
        {
            // Update blockmap
            MapComposite mapComposite=getMap();

            if(mapComposite!=null)
            {
                Map map=mapComposite.getMap();
                int tileWidth=map.getTileWidth();
                int tileHeight=map.getTileHeight();
                if((mPos.x/tileWidth!=p.x/tileWidth
                    ||mPos.y/tileHeight!=p.y/tileHeight))
                {
                    map.freeTile(mPos.x/tileWidth, mPos.y/tileHeight,
                          getBlockType());
                    map.blockTile(p.x/tileWidth, p.y/tileHeight, getBlockType());
                }
            }

            mPos=p;
        }