Exemple #1
0
        internal void RearrangeAux(Formation formation, bool isDirectly)
        {
            float num           = Math.Max(1f, Math.Max(formation.Depth, formation.Width) * 0.8f);
            float lengthSquared = (formation.CurrentPosition - formation.OrderPosition.AsVec2).LengthSquared;

            if (!isDirectly && (double)lengthSquared < (double)num * (double)num)
            {
                ArrangementOrder.TransposeLineFormation(formation);
                formation.OnTick += new Action <Formation>(formation.TickForColumnArrangementInitialPositioning);
            }
            else
            {
                formation.OnTick           -= new Action <Formation>(formation.TickForColumnArrangementInitialPositioning);
                formation.ReferencePosition = new Vec2?();
                formation.Rearrange(this.GetArrangement(formation));
            }
        }