コード例 #1
0
        public Formation GetLineFormation()
        {
            Formation form = new Formation("Line");
            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(0, 1));
            form.AddFormationPosition(new Vector2(-1, 1));
            form.AddFormationPosition(new Vector2(-2, 1));
            form.AddFormationPosition(new Vector2(1, 1));

            return form;
        }
コード例 #2
0
        public Formation GetFightingVFormation()
        {
            Formation form = new Formation("Fighting V");
            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(0, -1));
            form.AddFormationPosition(new Vector2(-1, -1));
            form.AddFormationPosition(new Vector2(-1, -2));
            form.AddFormationPosition(new Vector2(1, -2));

            return form;
        }
コード例 #3
0
        public Formation GetDiamondFormation()
        {
            Formation form = new Formation("Diamond");
            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(-1, 0));
            form.AddFormationPosition(new Vector2(1, 0));
            form.AddFormationPosition(new Vector2(0, -2));
            form.AddFormationPosition(new Vector2(0, 2));

            return form;
        }
コード例 #4
0
        public Formation GetBoxFormation()
        {
            Formation form = new Formation("Box");
            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0,0));

            form.AddFormationPosition(new Vector2(-1, -1));
            form.AddFormationPosition(new Vector2(0, 1));
            form.AddFormationPosition(new Vector2(0, -1));
            form.AddFormationPosition(new Vector2(-1, 1));

            return form;
        }
コード例 #5
0
        public Formation GetShieldFormation()
        {
            Formation form = new Formation("Shield");

            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(0, 1));
            form.AddFormationPosition(new Vector2(-1, 0));
            form.AddFormationPosition(new Vector2(1, 0));
            form.AddFormationPosition(new Vector2(-1, 1));

            return(form);
        }
コード例 #6
0
        public Formation GetFightingVFormation()
        {
            Formation form = new Formation("Fighting V");

            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(0, -1));
            form.AddFormationPosition(new Vector2(-1, -1));
            form.AddFormationPosition(new Vector2(-1, -2));
            form.AddFormationPosition(new Vector2(1, -2));

            return(form);
        }
コード例 #7
0
        public Formation GetDiamondFormation()
        {
            Formation form = new Formation("Diamond");

            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(-1, 0));
            form.AddFormationPosition(new Vector2(1, 0));
            form.AddFormationPosition(new Vector2(0, -2));
            form.AddFormationPosition(new Vector2(0, 2));

            return(form);
        }
コード例 #8
0
        public Formation GetBoxFormation()
        {
            Formation form = new Formation("Box");

            // Add Captain Position, always 0,0
            form.AddFormationPosition(new Vector2(0, 0));

            form.AddFormationPosition(new Vector2(-1, -1));
            form.AddFormationPosition(new Vector2(0, 1));
            form.AddFormationPosition(new Vector2(0, -1));
            form.AddFormationPosition(new Vector2(-1, 1));

            return(form);
        }
コード例 #9
0
 public override void SetFormation(Formation form)
 {
     m_fCurrFormation = form;
 }
コード例 #10
0
 public void SetCurrentFormation(Formation curr)
 {
     m_fCurrFormation = curr;
 }
コード例 #11
0
 public abstract void SetFormation(Formation form);
コード例 #12
0
 public override void SetFormation(Formation form)
 {
     m_fCurrFormation = form;
     Vector2 leaderIndex = Map.MapHandler.GetInstance().GetTileIndex(m_geSquadLeader.GetWorldPosition());
     for (int i = 0; i < m_fCurrFormation.GetFormationSize()-1 && i < m_lstSquad.Count; i++)
     {
         FormationPosition formation = m_fCurrFormation.GetFormationPosition(i + 1);
         Vector2 minionPos = Vector2.Add(leaderIndex, formation.GetPositionIndex());
         //m_lstSquad[i].MoveTo(minionPos);
         m_lstSquad[i].SetPosition(Map.MapHandler.GetInstance().GetTilePosition(minionPos));
     }
 }