Ejemplo n.º 1
0
        public List<ICommand> getTypeCommands()
        {
            List<ICommand> cmdlist = new List<ICommand>();

            ICommand cmd;

            if (this.intMovement > 0)
            {
                cmd = new comMove(this);
                cmdlist.Add(cmd);
            }

            if (this.intResourceValue > 0)
            {
                cmd = new comDropResource(this, null);
                cmdlist.Add(cmd);

                if (this.blnCanSpawnUnits)
                {
                    cmd = new comPlaceUnit(this);
                    cmdlist.Add(cmd);
                }
            }

            if (this.intCreateValuePerRound > 0)
            {
                cmd = new comCreateResource(this);
                cmdlist.Add(cmd);
            }

            return cmdlist;
        }
Ejemplo n.º 2
0
        private void createPlaceCommandsForSektor(Sektor aktSek, int intFieldsMoved)
        {
            foreach (clsSektorKoordinaten aktVektor in m_DirectionVektors)
            {
                Sektor newSek = this.FieldField.move(aktSek, aktVektor);

                if (newSek != null && aktSek.strUniqueID != newSek.strUniqueID)
                {
                    comPlaceUnit readyCmd = new comPlaceUnit(m_Unit, this.actingPlayer, m_Unit.firstUnitSpawnType);

                    readyCmd.TargetSektor = this.FieldField.get(newSek.objSektorKoord);

                    this.raiseOnNewCommand(readyCmd);

                    intFieldsMoved += 1;

                    if (intFieldsMoved < 1)
                        createPlaceCommandsForSektor(newSek, intFieldsMoved);
                }
            }
        }
Ejemplo n.º 3
0
        public List<ICommand> getResourceCommands(Player owner)
        {
            List<ICommand> placeUnitCommands = new List<ICommand>();
            // Todo: Accessible-Fields Property für Player: Felder die Einheiten platziert werden können (Ruleset?)
            foreach (Sektor sektor in owner.accessibleSectors)
            {
                comPlaceUnit cmd = new comPlaceUnit(null, owner, this);
                cmd.CommandId = Guid.NewGuid().ToString();
                cmd.TargetSektor = sektor;
                placeUnitCommands.Add(cmd);
            }

            return placeUnitCommands.ToList<ICommand>();
        }