Exemplo n.º 1
0
    public override void InitializeAgent()
    {
        base.InitializeAgent();
        goalDetect       = block.GetComponent <GoalDetect>();
        goalDetect.agent = this;
        rayPer           = GetComponent <RayPerception>();
        localDifficulty  = academy.difficulty;
        scanAgent        = GetComponent <ScanAgent>();
        SetActive(true);

        if (academy.useScan)
        {
            SetActive(false);
            scanAgent.SetActive(true);
        }
        else
        {
            scanAgent.SetActive(false);
        }


        // Cache the agent rigidbody
        agentRB = GetComponent <Rigidbody>();
        // Cache the block rigidbody
        blockRB = block.GetComponent <Rigidbody>();
        // Get the ground's bounds
        areaBounds = ground.GetComponent <Collider>().bounds;
        // Get the ground renderer so we can change the material when a goal is scored
        groundRenderer = ground.GetComponent <Renderer>();
        // Starting material
        groundMaterial = groundRenderer.material;
    }
Exemplo n.º 2
0
        public void Setup()
        {
            _directoryMock            = new Mock <IDirectory>();
            _directoryInfoFactoryMock = new Mock <IDirectoryInfoFactory>();
            _fileInfoFactoryMock      = new Mock <IFileInfoFactory>();

            _agent = new ScanAgent(_directoryMock.Object, _directoryInfoFactoryMock.Object, _fileInfoFactoryMock.Object);
        }
Exemplo n.º 3
0
        public static async Task Main(string[] args)
        {
            Console.WriteLine("Please enter directory to scan: ");
            var path = Console.ReadLine();

            var agent      = new ScanAgent();
            var scanResult = await agent.ScanFolderAsync(path);

            Print(scanResult.Items);

            Console.WriteLine();
            Console.WriteLine($"Total Files : {scanResult.TotalFiles}");
            Console.WriteLine($"Total Size : {scanResult.TotalSize} bytes");

            PrintErrors(scanResult.Errors);
        }