コード例 #1
0
ファイル: DropFlag.cs プロジェクト: SK0P3iN/IA-GOAP
 private void Awake()
 {
     _soldier = GetComponent <Soldier>();
     _flag    = FindObjectOfType <FlagComponent>();
     AddPrecondition("hasFlag", true); // we must have the flag to drop it at the base
     AddEffect("hasFlag", false);      // we will no longer have the flag after we drop it
 }
コード例 #2
0
 private void Awake()
 {
     _tm      = FindObjectOfType <TeamManager>();
     _soldier = GetComponent <Soldier>();
     _flag    = FindObjectOfType <FlagComponent>();
     AddPrecondition("hasFlag", true); // we must have the flag to drop it at the base
     AddEffect("scored", true);        // we will have dropped the flag once we finish
     AddEffect("hasFlag", false);      // we will no longer have the flag after we drop it
 }
コード例 #3
0
        private void Awake()
        {
            _me   = GetComponent <Soldier>();
            _tm   = FindObjectOfType <TeamManager>();
            _flag = FindObjectOfType <FlagComponent>();

            AddEffect("Captured", false);
            AddEffect("attacked", true);
        }
コード例 #4
0
ファイル: PickUpFlag.cs プロジェクト: SK0P3iN/IA-GOAP
        private void Awake()
        {
            AddPrecondition("hasFlag", false); // we cannot have the flag to pick up the flag
            AddEffect("hasFlag", true);        // we will have the flag after we picked it up

            // cache the flag
            _flag  = FindObjectOfType <FlagComponent>();
            Target = _flag.gameObject;
        }
コード例 #5
0
 public EntitiesWithFlagComponentEnumerable(
     FlagComponents[] flags,
     FlagComponent flag,
     int usedComponents
     )
 {
     Flags          = flags;
     Flag           = flag;
     UsedComponents = usedComponents;
 }
コード例 #6
0
        //private TeamManager _tm;
        // Start is called before the first frame update
        private void Awake()
        {
            //_tm = FindObjectOfType<TeamManager>();
            _soldier = GetComponent <ISoldier>();
            //AddPrecondition("hasFlag", false); // we cannot have the flag to pick up the flag
            //AddEffect("hasFlag", true); // we will have the flag after we picked it up

            // cache the flag
            _flag = FindObjectOfType <FlagComponent>();
            //Target = GameObject.Find("NE");
        }
コード例 #7
0
        protected override void Awake()
        {
            base.Awake();
            AddPrecondition("hasFlag", false); // we cannot have the flag to pick up the flag
            //AddPrecondition("dropFlag", false);
            AddEffect("hasFlag", true);        // we will have the flag after we picked it up
            ActionName = General_Scripts.Enums.Actions.PickupFlag;

            // cache the flag
            _flag  = FindObjectOfType <FlagComponent>();
            Target = _flag.gameObject;
        }
コード例 #8
0
 public EntitiesWithFlagComponentEnumerator(
     FlagComponents[] flags,
     FlagComponent flag,
     int usedComponents
     )
 {
     Current        = default;
     Index          = 1; // 0 is a magic number, never used so don't start there
     UsedComponents = usedComponents;
     Flags          = flags;
     Flag           = flag;
 }
コード例 #9
0
        private void Awake()
        {
            Flag = FindObjectOfType <FlagComponent>();
            Army = FindObjectsOfType <Soldier>().ToList();

            AllBases = new Dictionary <Base, bool>();
            var allB = FindObjectsOfType <Base>().ToList();

            foreach (var @base in allB)
            {
                AllBases.Add(@base, false);
            }

            OtherTeam = MyTeam == Teams.RedTeam ? Teams.BlueTeam : Teams.RedTeam;
            Enemies   = FindObjectsOfType <MonoBehaviour>().OfType <ISoldier>().Where(s => s.MyTeam == OtherTeam).ToList();
        }
コード例 #10
0
 public void ClearFlag(FlagComponent f) => SetFlags &= ~(ulong)f;
コード例 #11
0
 public void SetFlag(FlagComponent f) => SetFlags   |= (ulong)f;
コード例 #12
0
 public bool HasFlag(FlagComponent f) => (SetFlags & (ulong)f) != 0;