// Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2015
//
// Sewer Glue
#include <stdio.h>
#include		<unistd.h>
#include		"SewerGlue.hpp"

static int		GoToBinDir(const std::string		&path)
{
  std::string		file = path;
  unsigned int		i;

  for (i = file.length(); i > 0 && file[i] != '/' && file[i] != '\\'; --i);
  file[++i] = '\0';
  if (chdir(file.c_str()) == -1)
    return (-1);
  return (0);
}

int			main(int		argc,
			     char		**argv)
{
  (void)argc;
  if (GoToBinDir(*argv) == -1)
    return (EXIT_FAILURE);
  hbs::SewerGlue	sg;

  // srand(time(NULL));
  if (sg.Start() == false)
    return (EXIT_FAILURE);
  sg.Play();
  return (EXIT_SUCCESS);
}

