Exemple #1
0
    /** Timer */
    //public static Stopwatch stopWatch;

    /*************** Functions ***********************/

    /// <summary>
    /// Initializes a new instance of the <see cref="CapirBox"/> class.
    /// </summary>
    /// <param name='caller'>
    /// The main game script which initialize CapirBox.
    /// </param>
    public CapirBox(MainCSharp caller)
    {
        parentScript     = caller;
        existingNPCTypes = new int[GameConstants.NumNPCTypes];
        // initialize to existingNPCTypes
        Utilities.Populate <int>(existingNPCTypes, -1);

        npcTypes = new List <int>();

        QValues = new List <double[, , ]>();      // new List<List<List<double>>>();
        //StateMaps = new List<Dictionary<VirtualState, int>>();

        //stopWatch = new Stopwatch();
    }
Exemple #2
0
    /// <summary>
    /// Start this instance.
    /// </summary>
    protected virtual void Start()
    {
        levelGenerator = GameObject.FindWithTag("LevelGenerator").GetComponent <MainCSharp>();
        levelData      = levelGenerator.levelData;

        isMoving = false;
        isSolved = false;

        myIndex = int.Parse(this.gameObject.name);

        // get agent and helper
        agent         = GameObject.FindGameObjectWithTag("Player");
        helper        = GameObject.FindGameObjectWithTag("Helper");
        addedDistance = 0;
    }
Exemple #3
0
    //
    /// <summary>
    /// Start this instance, used for initialization.
    /// </summary>
    void Start()
    {
        // if agentPersistence is not set, set it to 0.8
        if (agentPersistence == 0)
        {
            agentPersistence = 0.8f;
        }

        isActing    = false;
        movingSteps = 0;

        levelGenerator = GameObject.FindWithTag("LevelGenerator").GetComponent <MainCSharp>();

        capirBox = levelGenerator.capirBox;
    }
Exemple #4
0
    /************ Main functions ***************************/

    //
    //
    /// <summary>
    /// Start this instance.
    /// </summary>
    /// <remarks>
    /// The initialization is placed here so that it is called
    /// after Awake routine in <see cref="MainCSharp"/> is called for game init.
    /// </remarks>
    void Start()
    {
        levelGenerator = GameObject.FindWithTag("LevelGenerator").GetComponent <MainCSharp>();
        //levelData = levelGenerator.GetComponent<MainCSharp>().levelData;

        minMajorDist = 15;

        isMoving = false;
        action   = (int)GameConstants.actions.unchanged;

        trackers      = new List <TouchCTracker>();
        trackerLookup = new Dictionary <int, TouchCTracker>();

        attackedGhost = null;
    }