public UserInput(Scripting.IMover mover, Scripting.ISoundPlayer soundPlayer, Scripting.IItemPicker itemPicker, World.NavMeshes.NavMesh navMesh) { elapsedIgnoreMilliseconds = 0; ignoringInput = false; interpreter = new Scripting.PlayerInterpreter(mover, soundPlayer, itemPicker); this.navMesh = navMesh; }
public BugMind(Scripting.IMover mover, Scripting.ILocator locator, World.NavMeshes.NavMesh navMesh, int bugId, List <Scripting.Instructions.Instruction> behavior) { this.bugId = bugId; this.behavior = behavior; aiType = BugAI.AIType.Bug1Behavior; instructionCounter = 0; interpreter = new Scripting.BugInterpreter(mover, locator, navMesh, bugId); }
public PlayerInterpreter(Scripting.IMover mover, Scripting.ISoundPlayer soundPlayer, Scripting.IItemPicker itemPicker) { this.mover = mover; this.soundPlayer = soundPlayer; this.itemPicker = itemPicker; dictionary = new Dictionary <Instructions.OpCodes, Action <int> >(); dictionary.Add(Instructions.OpCodes.PlaySound, PlaySound); dictionary.Add(Instructions.OpCodes.MoveTo, MoveTo); dictionary.Add(Instructions.OpCodes.IgnoreInput, IgnoreInput); dictionary.Add(Instructions.OpCodes.PickupBerry, PickupBerryAt); dictionary.Add(Instructions.OpCodes.PickupSunblock, PickupSunblockAt); }
public LocationContainer(Scripting.IMover mover, World.NavMeshes.NavMesh navMesh) { this.mover = mover; this.navMesh = navMesh; bugAI = new Input.BugAI(mover, navMesh, this); locations = new List <Location>(Globals.LocationCount); for (int i = 0; i < Globals.LocationCount; i++) { locations.Add(new Location(false, false, false, false)); } playerLocationId = 0; bugLocations = new Dictionary <int, int>(); waveConfigurations = WaveBuilder.DefaultWaves(); ResetGame(); }
public BugInterpreter(Scripting.IMover mover, Scripting.ILocator locator, World.NavMeshes.NavMesh navMesh, int bugId) { this.bugId = bugId; this.mover = mover; this.locator = locator; this.navMesh = navMesh; totalIdlingTime = 0; maxIdlingTime = 0; idling = false; dictionary = new Dictionary <Instructions.OpCodes, Action <int> >(); dictionary.Add(Instructions.OpCodes.MoveTo, MoveTo); dictionary.Add(Instructions.OpCodes.Bite, Bite); dictionary.Add(Instructions.OpCodes.TryNorth, TryNorth); dictionary.Add(Instructions.OpCodes.TrySouth, TrySouth); dictionary.Add(Instructions.OpCodes.TryWest, TryWest); dictionary.Add(Instructions.OpCodes.TryEast, TryEast); dictionary.Add(Instructions.OpCodes.Idle, Idle); }
public BugAI(Scripting.IMover mover, World.NavMeshes.NavMesh navMesh, Scripting.ILocator locator) { this.mover = mover; this.navMesh = navMesh; this.locator = locator; bugs = new List <BugMind>(); bugType1Behavior = new List <Scripting.Instructions.Instruction> { new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), }; bugType2Behavior = new List <Scripting.Instructions.Instruction> { new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryEast, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryWest, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), }; bugType3Behavior = new List <Scripting.Instructions.Instruction> { new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TrySouth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.TryNorth, 0), new Scripting.Instructions.Instruction(Scripting.Instructions.OpCodes.Idle, 800), }; }