Beispiel #1
0
        public bool ProductionCompleted()
        {
            bool result = false;
            //localiser le camp le plus proche pour envoyer l'unit
            //incrementer ce camp
            ComponentFilter  cf = new ComponentFilter(0);
            int              x  = GetParent().X;
            int              y  = GetParent().Y;
            ComponentManager cm = GetParent().GetLevel().GetComponentManager();
            Component        c  = cm.GetClosestComponent(x, y, cf);

            while (c != null)
            {
                Data d = null;
                if (m_vUnits.Count > 0)
                {
                    d = m_vUnits[0].Data;
                }
                if (!((UnitStorageComponent)c).CanAddUnit((CombatItemData)d))
                {
                    //Storage camp is full
                    cf.AddIgnoreObject(c.GetParent());
                    c = cm.GetClosestComponent(x, y, cf);
                }
                else
                {
                    break;
                }
            }

            if (c != null)
            {
                var cd = (CombatItemData)m_vUnits[0].Data;
                ((UnitStorageComponent)c).AddUnit(cd);
                StartProducingNextUnit();
                result = true;
            }
            else
            {
                m_vIsWaitingForSpace = true;
            }
            return(result);
        }
Beispiel #2
0
        public bool TestComponent(Component c)
        {
            GameObject go = c.GetParent();

            return(TestGameObject(go));
        }
Beispiel #3
0
        public bool TestComponent(Component c)
        {
            GameObject parent = c.GetParent();

            return(this.TestGameObject(parent));
        }
 public bool TestComponent(Component c)
 {
     GameObject go = c.GetParent();
     return TestGameObject(go);
 }