예제 #1
0
파일: clsUnitType.cs 프로젝트: hche/GCML
        //Funktionen
        public List<ICommand> getTypeCommands(clsUnit CallingUnit)
        {
            Move cmd = new Move();
            cmd.Unit = CallingUnit;

            List<ICommand> cmdlist = new List<ICommand>();
            cmdlist.Add(cmd);
            return cmdlist;
        }
예제 #2
0
파일: MoveFactory.cs 프로젝트: hche/GCML
        private void createMoveCommandsForSektor(Sektor aktSek, int intFieldsMoved)
        {
            foreach (clsSektorKoordinaten aktVektor in m_DirectionVektors)
            {
                Sektor newSek = this.FieldField.move(aktSek, aktVektor);

                if (newSek != null && aktSek.strUniqueID != newSek.strUniqueID)
                {

                    if (!m_listKnownMovements.Contains(newSek.strUniqueID))
                    {
                        m_listKnownMovements.Add(newSek.strUniqueID);

                        Move readyCmd = new Move();
                        readyCmd.Unit = m_Unit;
                        readyCmd.CommandId = Guid.NewGuid().ToString();

                        readyCmd.OriginSektor = m_originSektor;

                        Sektor targetSek = this.FieldField.get(newSek.objSektorKoord);

                        readyCmd.TargetSektor = targetSek;

                        raiseOnNewMoveCommand(readyCmd);
                    }

                    int intNewFieldsMoved = intFieldsMoved + newSek.intMoveCost;

                    if (intNewFieldsMoved < m_Unit.intMovement)
                    {
                        createMoveCommandsForSektor(newSek, intNewFieldsMoved);
                    }
                }

            }
        }
예제 #3
0
파일: MoveFactory.cs 프로젝트: hche/GCML
 private void raiseOnNewMoveCommand(Move readyCmd)
 {
     if (onNewMoveCommand != null)
         onNewMoveCommand(readyCmd);
 }