Ejemplo n.º 1
0
    private void OnMouseUp()
    {
        if (EventSystem.current.IsPointerOverGameObject())
        {
            return;
        }


        if (VisitingIQ > Parameters.get(ParamsKind.IQ).Value)
        {
            GUImain.ShowMessage("ZINĀŠANAS!", "Tavs zināšanu līmenis ir pārāk zems! \nNepieciešamais IQ ir " + VisitingIQ);
            return;
        }

        if (!CanVisit(true))
        {
            ShowCloseDialog();
            return;
        }

        if (!(this is MapBuilding))
        {
            DayClass.IncHour();
        }

        GameManager.SelectedBuilding = this;
        Quest.Execute(this);
        SelectBuilding();
    }
Ejemplo n.º 2
0
    public void CheckChartSelected()
    {
        DayClass selectedDay = new DayClass();

        ReadJson.instance.days.TryGetValue(ReadJson.instance.selectedDay, out selectedDay);
        selectedDay.chart.Select();
    }
Ejemplo n.º 3
0
    public void Process(int tag)
    {
        int money = 0;
        int well  = 0;

        switch (tag)
        {
        case 0:
            money = 100;
            well  = 5;
            break;

        case 1:
            money = 200;
            well  = 7;
            break;

        case 2:
            money = 1000;
            well  = 15;
            break;
        }

        if (GameManager.AddMoney(-money))
        {
            Parameters.get(ParamsKind.WELL).Value += well;
            DayClass.IncHour();
        }
    }
Ejemplo n.º 4
0
 public void Setup(DayClass day)
 {
     this.day     = day;
     this.summary = day.day.summary;
     AddSums();
     SetHeight();
 }
Ejemplo n.º 5
0
    // Drawing Timeline
    void CheckIfCanDraw(bool rightDirection = true)
    {
        StopAllCoroutines();
        bool loaded = false;

        while (loaded == false)
        {
            DayClass timeline = new DayClass();
            loaded = days.TryGetValue(selectedDay, out timeline);
            if (loaded)
            {
                foreach (Transform child in historySpawn.gameObject.transform)
                {
                    if (child.gameObject.GetComponent <ActivityUI>() != null)
                    {
                        Destroy(child.gameObject);
                    }
                }
                foreach (Transform child in summariesGO.transform)
                {
                    if (child.gameObject.GetComponent <SummaryItem>() != null)
                    {
                        Destroy(child.gameObject);
                    }
                }
                activitiesList.Clear();
                summaries.Clear();
                DrawTimeline(timeline.day, timeline.canChangeWeight);
            }
            else
            {
                if (selectedDay == lastDate.AddDays(1))
                {
                    selectedDay = selectedDay.AddDays(-1);
                }
                else if (selectedDay == firstDate.Value.AddDays(-1))
                {
                    selectedDay = selectedDay.AddDays(1);
                }
                else
                {
                    if (rightDirection)
                    {
                        selectedDay = selectedDay.AddDays(1);
                    }
                    else
                    {
                        selectedDay = selectedDay.AddDays(-1);
                    }
                }
            }
        }
    }
Ejemplo n.º 6
0
    protected virtual void OnHourChange(int hour)
    {
        if (DayClass.DayLights())
        {
            Lights(false);
            return;
        }

        if (!ControlBuilding)
        {
            return;
        }
        Lights(ControlBuilding.CanVisit());
    }
Ejemplo n.º 7
0
    public void CheckTimeForQuestion()
    {
        DayClass day = days[currentDay];

        if (day.timeToAsk.Length > currentDayQuestion)
        {
            if (day.timeToAsk[currentDayQuestion] == dayTime)
            {
                notificationTittle.text = day.tittle[currentDayQuestion];
                notification.SetActive(true);
                dialogue.Add(day.dayQuestions);
                waitingForOpen = true;
                waitingTime    = timeToOpen;
            }
        }
    }
Ejemplo n.º 8
0
    void LoadFiles(string jsonData, bool canChangeWeight)
    {
        string        text = "{ day: " + jsonData + "}";
        FullStoryLine m    = JsonConvert.DeserializeObject <FullStoryLine>(text);

        foreach (var item in m.day)
        {
            DateTime timelineDay = ReturnSimpleDate(item.date);
            if (!days.ContainsKey(timelineDay) && item.summary != null)
            {
                DayClass tempDay = new DayClass(timelineDay, item, dayNumber++, canChangeWeight);
                days.Add(timelineDay, tempDay);
                daysToDraw.Add(tempDay);
            }
        }
        //RenderMap.instance.ChangeDaysRangeFilter(new DateTime(2018, 03, 01), new DateTime(2018, 03, 10));
    }
Ejemplo n.º 9
0
    protected override void OnHourChange(int hour)
    {
        if (DayClass.DayLights() || DayClass.CloseLights())
        {
            CloseAll();
            return;
        }
        if (!Building)
        {
            CloseAll();
            return;
        }

        if (Building is Office && !Building.CanVisit() || !Building.CanWork())
        {
            CloseAll();
        }
        else
        {
            OpenAll();
        }
    }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            int    dayNumber = 0;
            string filename  = "input";

            if (args.Length > 0)
            {
                Int32.TryParse(args[0], out dayNumber);
                if (args.Length > 1)
                {
                    filename = args[1];
                }
            }
            if (dayNumber < 1 || dayNumber > 25)
            {
                Console.Error.WriteLine("Day number must be between 1 and 25");
                Environment.Exit(1);
            }
            Day day = DayClass.NewDay(dayNumber);

            if (day == null)
            {
                Console.WriteLine("No solution found.");
                Environment.Exit(3);
            }
            string path = $"data/day/{dayNumber}/{filename}.txt";

            if (!File.Exists(path))
            {
                Console.Error.WriteLine("File '{0}' does not exist.", path);
                Environment.Exit(2);
            }
            else
            {
                day.ReadInputFile(path);
                SolvePart(1, day.SolvePart1);
                SolvePart(2, day.SolvePart2);
            }
        }
Ejemplo n.º 11
0
    protected virtual void OnHourChange(int hour)
    {
        if (DayClass.CloseLights())
        {
            CloseAll();
            return;
        }
        if (DayClass.DayLights())
        {
            return;
        }

        foreach (SpriteRenderer win in windows)
        {
            if (win.gameObject.activeSelf && DayClass.Hour > 0)
            {
                continue;
            }

            win.color = Random.ColorHSV();
            win.gameObject.SetActive(Random.value < 0.1f);
        }
    }
Ejemplo n.º 12
0
 public void GotoWork()
 {
     PlayerStatus     = PlayerStatus.NONE;
     SelectedBuilding = CurrentWork;
     DayClass.IncHour();
 }
Ejemplo n.º 13
0
 // Update is called once per frame
 void Update()
 {
     DayClass.Update();
 }
Ejemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     SelectedBuilding = MapBuilding;
     DayClass.Init(7);
 }
Ejemplo n.º 15
0
 // Update is called once per frame
 void Update()
 {
     GetComponent <Light>().enabled = !DayClass.DayLights();
 }