Exemplo n.º 1
0
        private bool MakeSurePlaceHolderExists()
        {
            if (m_placeholder != null)
            {
                return(true);
            }

            var untouchPlaceholders = WeaponManager.GetUntouchedTurretPlaceholders();

            if (untouchPlaceholders.Count() > 0)
            {
                foreach (var p in untouchPlaceholders)
                {
                    if (p.Value.Placeholder.GetAABB().Intersects(Player.GetAABB()))
                    {
                        m_placeholder   = p.Value.Placeholder;
                        m_buildProgress = (int)Math.Round(m_placeholder.BuildProgress * MaxProgress);
                        WeaponManager.AddBuilderToTurretPlaceholder(m_placeholder.UniqueID, Player);
                        return(true);
                    }
                }
            }

            return(false);
        }