Пример #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
                m_ArmyHome = reader.ReadPoint3D();
                goto case 0;

            case 0:
                m_Owner                  = reader.ReadMobile();
                m_War                    = reader.ReadBool();
                m_Free                   = reader.ReadBool();
                m_ArmyDirection          = (Direction)reader.ReadInt();
                m_ArmyFormationDirection = (Direction)reader.ReadInt();
                m_CurrentFormation       = (ArmyFormationEnum)reader.ReadInt();
                Soldiers                 = reader.ReadMobileList();
                break;

            default:
                break;
            }
        }
Пример #2
0
 public void SetFormation(ArmyFormationEnum formation)
 {
     m_Free = false;
     if (formation != ArmyFormationEnum.Latest)
     {
         if (m_CurrentFormation == formation)
         {
             m_ArmyFormationDirection = (Direction)((1 + (int)m_ArmyFormationDirection) % 8);
         }
         else
         {
             m_CurrentFormation = formation;
         }
         if (m_CurrentFormation == ArmyFormationEnum.Triangle)
         {
             SetDirection((Direction)((7 + (8 - (int)m_ArmyFormationDirection)) % 8));
         }
         else
         {
             SetDirection((Direction)(((8 - (int)m_ArmyFormationDirection)) % 8));
         }
     }
     GoThere(m_ArmyHome);
     UpdateAction();
 }
Пример #3
0
 public ArmyController()
     : base(3007)
 {
     Weight                   = 0.0;
     Name                     = "Army Controller";
     m_Owner                  = null;
     m_ArmyDirection          = Direction.North;
     m_ArmyFormationDirection = Direction.North;
     //m_ArmyDirection = Direction.North;
     m_CurrentFormation = ArmyFormationEnum.FullSquare;
 }