Ejemplo n.º 1
0
        /// <summary>
        /// If no position is available for unit, create a new position somewhat sensibly
        /// </summary>
        /// <param name="unitInfo"></param>
        /// <returns></returns>
        public FormationPosition CreateNewPositionForUnit(GameConstants.UnitType unitType)
        {
            FormationPosition fpos      = new FormationPosition();
            double            distanceM = 500;

            if (unitType == GameConstants.UnitType.FixedwingAircraft ||
                unitType == GameConstants.UnitType.Helicopter)
            {
                distanceM = 150;
            }
            //TODO: Make this more sensible
            distanceM           = distanceM * this.FormationPositions.Count;
            fpos.PositionOffset = new PositionOffset(distanceM / 3, (-1 * distanceM) / 2, 0);
            return(fpos);
        }
Ejemplo n.º 2
0
        public FormationPosition Clone()
        {
            FormationPosition fPosNew = (FormationPosition)this.MemberwiseClone();

            if (PositionOffset != null)
            {
                fPosNew.PositionOffset = PositionOffset.Clone();
            }
            else
            {
                Logger log = new Logger();
                log.LogWarning(
                    string.Format("FormationPosition {0} has PositionOffset null.", this.Id));
            }
            return(fPosNew);
        }