Exemplo n.º 1
0
 /// <summary>
 /// Validates an outpost
 /// </summary>
 /// <param name="outpost">The outpost to validate</param>
 /// <returns>If the outpost is valid</returns>
 public static bool ValidateOutpost(Outpost outpost)
 {
     if (outpost == null)
     {
         return(false);
     }
     if (!Game.TimeMachine.GetState().OutpostExists(outpost))
     {
         return(false);
     }
     if (outpost.GetDrillerCount() < 0)
     {
         return(false);
     }
     if (outpost.GetSpecialistManager() == null)
     {
         return(false);
     }
     if (outpost.GetSpecialistManager().GetSpecialistCount() < 0)
     {
         return(false);
     }
     if (outpost.GetSpecialistManager().GetSpecialistCount() > outpost.GetSpecialistManager().GetCapacity())
     {
         return(false);
     }
     if (outpost.GetOwner() != null && !Game.TimeMachine.GetState().PlayerExists(outpost.GetOwner()))
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Transfers ownership between outpost or specialists.
        /// </summary>
        /// <returns>If the event was successful</returns>
        public bool ForwardAction()
        {
            _originalOutpostOwner = _outpost.GetOwner();
            _originalDrillerCount = _outpost.GetDrillerCount();

            // Tie or sub won.
            if (_outpost.GetDrillerCount() < 0)
            {
                this.TransferOwnership();
            }
            else
            {
                if (_outpost.GetDrillerCount() == 0)
                {
                    // Was a tie.
                    if (_sub.GetSpecialistManager().GetSpecialistCount() > _outpost.GetSpecialistManager().GetSpecialistCount())
                    {
                        this.TransferOwnership();
                    }
                    else
                    {
                        this.CaptureSub();
                    }
                }
            }

            this._eventSuccess = true;
            return(true);
        }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        Text text = gameObject.GetComponentInChildren <Text>();

        text.text = "====Source Outpost====\n" +
                    "Outpost Id: " + source.GetId() + "\n" +
                    "Shields: " + source.GetShields() + "\n" +
                    "Drillers: " + source.GetDrillerCount() + "\n" +
                    "Specialists: " + source.GetSpecialistManager().GetSpecialistCount();
    }