public void StartNight_Gameroom()
        {
            IHotelTamagotchiContext c  = new FakeHotelTamagotchiContext();
            IHotelRoomRepository    hR = new HotelRoomRepository(c);
            ITamagotchiRepository   tR = new TamagotchiRepository(c);

            HotelRoomViewModel h = new HotelRoomViewModel()
            {
                Size = 5,
                Type = HotelRoomType.Gameroom,
            };

            hR.Add(h);

            TamagotchiViewModel t = new TamagotchiViewModel()
            {
                Name        = "Test",
                Alive       = true,
                HotelRoom   = h,
                HotelRoomId = h.Id,
                Boredom     = 50
            };

            tR.Add(t);

            NightController nC = new NightController(tR, hR);

            nC.StartNight();

            Assert.IsTrue(tR.Find(t.Id).Boredom == 0);
            Assert.IsTrue(tR.Find(t.Id).Pennies == 80);
        }
示例#2
0
 private void Start()
 {
     destroyPoint    = GameObject.Find("DestroyPoint").GetComponent <Transform>();
     nightController = GameObject.Find("TimeController").GetComponent <NightController>();
     image           = GetComponent <Image>();
     color.a         = 1f;
 }
        public void StartNight_Homeless()
        {
            IHotelTamagotchiContext c  = new FakeHotelTamagotchiContext();
            IHotelRoomRepository    hR = new HotelRoomRepository(c);
            ITamagotchiRepository   tR = new TamagotchiRepository(c);


            TamagotchiViewModel t = new TamagotchiViewModel()
            {
                Name  = "Test",
                Alive = true
            };
            TamagotchiViewModel t2 = new TamagotchiViewModel()
            {
                Name   = "Test2",
                Alive  = true,
                Health = 10,
            };

            tR.Add(t);
            tR.Add(t2);

            NightController nC = new NightController(tR, hR);

            nC.StartNight();

            Assert.IsTrue(tR.Find(t.Id).Boredom == 20);
            Assert.IsTrue(tR.Find(t.Id).Health == 80);

            Assert.IsTrue(tR.Find(t2.Id).Health == 0);
            Assert.IsTrue(tR.Find(t2.Id).Alive == false);
        }
示例#4
0
    void Start()
    {
        allpoints = GameObject.Find("PointsController").GetComponent <AllPoints>();
        if (allpoints == null)
        {
            Debug.Log("The game object -PointsController- not find in scene");
        }

        moneyCollect = GameObject.Find("PointsController").GetComponent <MoneyCollect>();
        if (moneyCollect == null)
        {
            Debug.Log("The game object -PointsController- not find in scene");
        }

        pointsCollect = GameObject.Find("PointsController").GetComponent <PointsCollect>();
        if (pointsCollect == null)
        {
            Debug.Log("The game object -PointsController- not find in scene");
        }

        nightController = GetComponent <NightController>();

        storageTime    = Time.time + waitTime;
        storageTimeDay = Time.time + dayChange;
    }
示例#5
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     textMesh = gameObject.GetComponentInChildren <TextMeshProUGUI>();
     animator = gameObject.GetComponentInChildren <Animator>();
     gameObject.SetActive(false);
 }
示例#6
0
        public void NightControllerIndex()
        {
            // Arrange
            NightController controller = new NightController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
示例#7
0
 void Start()
 {
     nightController   = NightControllerObj.GetComponent <NightController>();
     audioSource       = GetComponent <AudioSource>();
     spriteRenderer    = PlayerSpriteObj.GetComponent <SpriteRenderer>();
     animator          = GetComponent <Animator>();
     meleeController   = MeleeColliderObj.GetComponent <MeleeController>();
     buffBarController = BuffBarObj.GetComponent <BuffBarController>();
     buffBarController.buffDuration = buffDuration;
     meleeController.Damage         = MeleeDamage;
     movespeed = 1.2f + (1.2f * (GlobalDataScript.SpeedBonus / 100f));
 }
示例#8
0
    private void Start()
    {
        coinTextBox.SetActive(false);

        mainCharInv      = MainCharInventory.Instance;
        hotbarCont       = HotbarController.Instance;
        dialogCont       = DialogController.Instance;
        storeCont        = WebStoreController.Instance;
        mainCharCont     = MainCharacterController.Instance;
        settingsCont     = SettingsController.Instance;
        nightCont        = NightController.Instance;
        forestCanvasCont = ForestCanvasController.Instance;
        timeSystem       = TimeSystem.Instance;
        endGameCont      = EndGameController.Instance;
    }
示例#9
0
    // Use this for initialization
    void Start()
    {
        //hide the cursor
        Cursor.visible   = false;
        canMove          = true;
        health           = 2 + healthBonus;
        equippedItem     = 0;
        beans            = 0;
        isFloating       = false;
        bubble           = null;
        lastSwitchedItem = Time.time;
        canBubblewand    = true;

        controller     = GetComponent <CharacterController>();
        coll           = GetComponent <Collider>();
        spriteRenderer = GetComponent <SpriteRenderer>();
        animator       = GetComponent <Animator>();
        audioSource    = GetComponent <AudioSource>();
        inTornado      = false;

        night = GameObject.FindWithTag("Night").GetComponent <NightController>();
    }
示例#10
0
 void Start()
 {
     allPoints       = GameObject.Find("PointsController").GetComponent <AllPoints>();
     nightController = GameObject.Find("TimeController").GetComponent <NightController>();
 }
示例#11
0
 // Use this for initialization
 void Start()
 {
     timeText = GetComponent <Text>();
     night    = GameObject.FindWithTag("Night").GetComponent <NightController>();
     group    = transform.parent.gameObject.GetComponent <CanvasGroup>();
 }
示例#12
0
    // Start is called before the first frame update
    public void BreakThatEgg()
    {
        NightController nightController = FindObjectOfType <NightController>();

        DestroyObject(nightController.Egg);
    }