public IPosition Create(PositionRequirements requirements)
 {
     if (requirements.Row == true)
     {
         if (requirements.Height == true)
         {
             return(new OppositeHitter());
         }
         else
         {
             return(new PinchServer());
         }
     }
     else
     {
         if (requirements.Height == true)
         {
             return(new MiddleBlocker());
         }
         else
         {
             return(new Libero());
         }
     }
 }
 public IPosition Create(PositionRequirements requirements)
 {
     if (requirements.Row == true)
     {
         if (requirements.Height == true)
         {
             return(new OutsideHitter());
         }
         else
         {
             return(new Setter());
         }
     }
     else
     {
         if (requirements.Height == true)
         {
             return(new Ace());
         }
         else
         {
             return(new Defender());
         }
     }
 }
Exemple #3
0
    public void InputGather()
    {
        if (StyleDropdown.value == 1)
        {
            Style             = true; //Offensive
            m_currentPosition = new sOffense(m_currentPosition);
            //Debug.Log("Points Scored: " + m_currentPosition.GetPoints());
        }
        else
        {
            Style             = false; //Defensive
            m_currentPosition = new sDefense(m_currentPosition);
            //Debug.Log("Points Scored: " + m_currentPosition.GetPoints());
        }

        if (RowDropdown.value == 1)
        {
            Row = true; //Front
            m_currentPosition = new rFront(m_currentPosition);
            //Debug.Log("Points Scored: " + m_currentPosition.GetPoints());
        }
        else
        {
            Row = false; //Back
            m_currentPosition = new rBack(m_currentPosition);
            //Debug.Log("Points Scored: " + m_currentPosition.GetPoints());
        }

        if (HeightDropdown.value == 1)
        {
            Height            = true; //Tall
            m_currentPosition = new hTall(m_currentPosition);
            //Debug.Log("Points Scored: " + m_currentPosition.GetPoints());
        }
        else
        {
            Height            = false; //Short
            m_currentPosition = new hShort(m_currentPosition);
            //Debug.Log("Points Scored: " + m_currentPosition.GetPoints());
        }

        PositionRequirements requirements = new PositionRequirements();

        requirements.Height = Height;
        requirements.Row    = Row;
        requirements.Style  = Style;

        IPosition p = GetPosition(requirements);

        PlayerPosition.text = p.ToString() + "\nPoints Scored: " + p.GetPoints();

        //TextContainer = p.ToString();
        //TextContainer += "_3D";
        //Instantiate(Resources.Load(TextContainer), Center, Quaternion.identity, GameObject.FindGameObjectWithTag("Canvas").transform);
    }
Exemple #4
0
    public void InputGather()
    {
        if (StyleDropdown.value == 1)
        {
            Style = true; //Offensive
        }
        else
        {
            Style = false; //Defensive
        }

        if (RowDropdown.value == 1)
        {
            Row = true; //Front
        }
        else
        {
            Row = false; //Back
        }

        if (HeightDropdown.value == 1)
        {
            Height = true; //Tall
        }
        else
        {
            Height = false; //Short
        }

        PositionRequirements requirements = new PositionRequirements();

        requirements.Height = Height;
        requirements.Row    = Row;
        requirements.Style  = Style;

        IPosition p = GetPosition(requirements);

        //PlayerPosition = p.ToString();

        TextContainer  = p.ToString();
        TextContainer += "_3D";
        Instantiate(Resources.Load(TextContainer), Center, Quaternion.identity, GameObject.FindGameObjectWithTag("Canvas").transform);
    }
 public PositionFactory(PositionRequirements requirements)
 {
     _factory      = requirements.Style ? (IPositionFactory) new OffenseFactory() : new DefenseFactory();
     _requirements = requirements;
 }
Exemple #6
0
    private static IPosition GetPosition(PositionRequirements requirements)
    {
        PositionFactory factory = new PositionFactory(requirements);

        return(factory.Create());
    }