<?php

namespace Mine\SeekerBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Jotunheimr\UserBundle\Entity\User;

/**
 * PlayedGame
 *
 * @ORM\Table(name="played_game")
 * @ORM\Entity(repositoryClass="Mine\SeekerBundle\Repository\PlayedGameRepository")
 */
class PlayedGame
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="game_assoc", type="string", length=50, nullable=false)
     */
    private $gameAssoc;

    /**
     * @var Grid
     *
     * @ORM\OneToOne(targetEntity="Mine\SeekerBundle\Entity\Grid", mappedBy="playedGame", cascade={"persist"})
     */
    private $grid;

    /**
     * @var User
     *
     * @ORM\ManyToOne(targetEntity="Jotunheimr\UserBundle\Entity\User")
     * @ORM\JoinColumn(name="red_id", referencedColumnName="id", nullable=true)
     */
    private $red;

    /**
     * @var Gamer
     *
     * @ORM\ManyToOne(targetEntity="Mine\SeekerBundle\Entity\Gamer")
     * @ORM\JoinColumn(name="red_anon", referencedColumnName="id", nullable=true)
     */
    private $redAnon;

    /**
     * @var User
     *
     * @ORM\ManyToOne(targetEntity="Jotunheimr\UserBundle\Entity\User")
     * @ORM\JoinColumn(name="blue_id", referencedColumnName="id", nullable=true)
     */
    private $blue;

    /**
     * @var Gamer
     *
     * @ORM\ManyToOne(targetEntity="Mine\SeekerBundle\Entity\Gamer")
     * @ORM\JoinColumn(name="blue_anon", referencedColumnName="id", nullable=true)
     */
    private $blueAnon;

    /**
     * @var int
     *
     * @ORM\Column(name="red_points", type="integer", length=5, nullable=true)
     */
    private $redPoints;

    /**
     * @var int
     *
     * @ORM\Column(name="blue_points", type="integer", length=5, nullable=true)
     */
    private $bluePoints;

    /**
     * @var boolean
     *
     * @ORM\Column(name="red_exploded_bomb", type="boolean", nullable=true)
     */
    private $redExplodedBomb;

    /**
     * @var boolean
     *
     * @ORM\Column(name="blue_exploded_bomb", type="boolean", nullable=true)
     */
    private $blueExplodedBomb;

    /**
     * @var string
     *
     * @ORM\Column(name="resign", type="string", length=7, nullable=true)
     */
    private $resign;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created", type="datetime", nullable=true)
     */
    private $created;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="updated", type="datetime", nullable=true)
     */
    private $updated;

    /**
     * @var Step
     *
     * @ORM\OneToMany(targetEntity="Mine\SeekerBundle\Entity\Step", mappedBy="playedGame")
     * @ORM\JoinColumn(name="step", referencedColumnName="id", nullable=true)
     */
    private $step;


    /**
     * Constructor
     */
    public function __construct()
    {
        $this->step = new ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set gameAssoc
     *
     * @param string $gameAssoc
     *
     * @return PlayedGame
     */
    public function setGameAssoc($gameAssoc)
    {
        $this->gameAssoc = $gameAssoc;

        return $this;
    }

    /**
     * Get gameAssoc
     *
     * @return string
     */
    public function getGameAssoc()
    {
        return $this->gameAssoc;
    }

    /**
     * Set redPoints
     *
     * @param integer $redPoints
     *
     * @return PlayedGame
     */
    public function setRedPoints($redPoints)
    {
        $this->redPoints = $redPoints;

        return $this;
    }

    /**
     * Get redPoints
     *
     * @return integer
     */
    public function getRedPoints()
    {
        return $this->redPoints;
    }

    /**
     * Set bluePoints
     *
     * @param integer $bluePoints
     *
     * @return PlayedGame
     */
    public function setBluePoints($bluePoints)
    {
        $this->bluePoints = $bluePoints;

        return $this;
    }

    /**
     * Get bluePoints
     *
     * @return integer
     */
    public function getBluePoints()
    {
        return $this->bluePoints;
    }

    /**
     * Set redExplodedBomb
     *
     * @param string $redExplodedBomb
     *
     * @return PlayedGame
     */
    public function setRedExplodedBomb($redExplodedBomb)
    {
        $this->redExplodedBomb = $redExplodedBomb;

        return $this;
    }

    /**
     * Get redExplodedBomb
     *
     * @return string
     */
    public function getRedExplodedBomb()
    {
        return $this->redExplodedBomb;
    }

    /**
     * Set blueExplodedBomb
     *
     * @param string $blueExplodedBomb
     *
     * @return PlayedGame
     */
    public function setBlueExplodedBomb($blueExplodedBomb)
    {
        $this->blueExplodedBomb = $blueExplodedBomb;

        return $this;
    }

    /**
     * Get blueExplodedBomb
     *
     * @return string
     */
    public function getBlueExplodedBomb()
    {
        return $this->blueExplodedBomb;
    }

    /**
     * Set grid
     *
     * @param Grid $grid
     *
     * @return PlayedGame
     */
    public function setGrid(Grid $grid = null)
    {
        $this->grid = $grid;

        return $this;
    }

    /**
     * Get grid
     *
     * @return Grid
     */
    public function getGrid()
    {
        return $this->grid;
    }

    /**
     * Set red
     *
     * @param User $red
     *
     * @return PlayedGame
     */
    public function setRed(User $red = null)
    {
        $this->red = $red;

        return $this;
    }

    /**
     * Get red
     *
     * @return User
     */
    public function getRed()
    {
        return $this->red;
    }

    /**
     * Set redAnon
     *
     * @param Gamer $redAnon
     *
     * @return PlayedGame
     */
    public function setRedAnon(Gamer $redAnon = null)
    {
        $this->redAnon = $redAnon;

        return $this;
    }

    /**
     * Get redAnon
     *
     * @return Gamer
     */
    public function getRedAnon()
    {
        return $this->redAnon;
    }

    /**
     * Set blue
     *
     * @param User $blue
     *
     * @return PlayedGame
     */
    public function setBlue(User $blue = null)
    {
        $this->blue = $blue;

        return $this;
    }

    /**
     * Get blue
     *
     * @return User
     */
    public function getBlue()
    {
        return $this->blue;
    }

    /**
     * Set blueAnon
     *
     * @param Gamer $blueAnon
     *
     * @return PlayedGame
     */
    public function setBlueAnon(Gamer $blueAnon = null)
    {
        $this->blueAnon = $blueAnon;

        return $this;
    }

    /**
     * Get blueAnon
     *
     * @return Gamer
     */
    public function getBlueAnon()
    {
        return $this->blueAnon;
    }

    /**
     * Add step
     *
     * @param Step $step
     *
     * @return PlayedGame
     */
    public function addStep(Step $step)
    {
        $this->step[] = $step;

        return $this;
    }

    /**
     * Remove step
     *
     * @param Step $step
     */
    public function removeStep(Step $step)
    {
        $this->step->removeElement($step);
    }

    /**
     * Get step
     *
     * @return Collection
     */
    public function getStep()
    {
        return $this->step;
    }

    /**
     * Set resign
     *
     * @param string $resign
     *
     * @return PlayedGame
     */
    public function setResign($resign)
    {
        $this->resign = $resign;

        return $this;
    }

    /**
     * Get resign
     *
     * @return string
     */
    public function getResign()
    {
        return $this->resign;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     *
     * @return PlayedGame
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }

    /**
     * Set updated
     *
     * @param \DateTime $updated
     *
     * @return PlayedGame
     */
    public function setUpdated($updated)
    {
        $this->updated = $updated;

        return $this;
    }

    /**
     * Get updated
     *
     * @return \DateTime
     */
    public function getUpdated()
    {
        return $this->updated;
    }
}
