Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9609


Ignore:
Timestamp:
06/12/13 05:29:43 (9 years ago)
Author:
melkaref
Message:

#2069

  • Added EmptyEvent.cs
  • Modified Grammar.cs to allow EmptyEvent as a child in place of all Event Methods except for Run and OnScannedEvent
Location:
branches/Robocode/HeuristicLab.Problems.Robocode
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Robocode/HeuristicLab.Problems.Robocode/Grammar.cs

    r9565 r9609  
    9494            var onHitWall = new OnHitWall();
    9595            var onScannedRobot = new OnScannedRobot();
     96            var emptyEvent = new EmptyEvent();
    9697           
    9798            var run = new Run();
     
    145146            var eventSymbols = new List<ISymbol>()
    146147            {
    147                 run, onBulletHit, onBulletMissed, onHitByBullet, onHitRobot, onHitWall, onScannedRobot, block
     148                run, onBulletHit, onBulletMissed, onHitByBullet,
     149                onHitRobot, onHitWall, onScannedRobot, block, emptyEvent
    148150            };
    149151            #endregion
     
    246248            }
    247249
     250            // Add all Event Methods to Tank. Run and OnScannedEvent are not optional,
     251            // so EmptyEvent cannot take their places
     252
    248253            AddAllowedChildSymbol(tank, run, 0);
    249             AddAllowedChildSymbol(tank, onBulletHit, 1);
     254            AddAllowedChildSymbol(tank, onScannedRobot, 1);
    250255            AddAllowedChildSymbol(tank, onBulletMissed, 2);
    251256            AddAllowedChildSymbol(tank, onHitByBullet, 3);
    252257            AddAllowedChildSymbol(tank, onHitRobot, 4);
    253258            AddAllowedChildSymbol(tank, onHitWall, 5);
    254             AddAllowedChildSymbol(tank, onScannedRobot, 6);
     259            AddAllowedChildSymbol(tank, onBulletHit, 6);
     260            for (int i = 2; i < tank.MaximumArity; i++)
     261                AddAllowedChildSymbol(tank, emptyEvent, i);
    255262
    256263            AddAllowedChildSymbol(StartSymbol, tank, 0);
  • branches/Robocode/HeuristicLab.Problems.Robocode/HeuristicLab.Problems.Robocode.csproj

    r9567 r9609  
    109109    </Compile>
    110110    <Compile Include="SolutionProgramView.Designer.cs" />
     111    <Compile Include="Symbols\Event Methods\Events\EmptyEvent.cs" />
    111112    <Compile Include="Symbols\Numerical Methods\INumericalMethod.cs" />
    112113    <Compile Include="Symbols\Void Methods\Ahead.cs" />
Note: See TracChangeset for help on using the changeset viewer.