Пример #1
0
        public void InterpolateChange(Clock clock, ClockEventArgs args)
        {
            if (currentMonth != args.month) {
            currentMonth = args.month;

            NetworkManager.Send(
                PredictionProtocol.Prepare(),
                ProcessPrediction
            );
            }

            if (currentDay != args.day) {
            currentDay = args.day;
                /*
            if (results.Count > 0) {
                foreach (KeyValuePair<int, int> entry in results) {
                    int group_id = entry.Key, biomass = entry.Value;

                    Species speciesGroup = gameObject.GetComponent<GameState>().GetSpeciesGroup(group_id);

                    if (speciesGroup != null) {
                        int nextBiomass = speciesGroup.size + biomass / 30;
                        gameObject.GetComponent<GameState>().UpdateSpecies(group_id, nextBiomass);

                        if (nextBiomass < 0) {
                            gameObject.GetComponent<Chat>().SetMessage(speciesGroup.name + " decreased by " + -nextBiomass);
                        } else {
                            gameObject.GetComponent<Chat>().SetMessage(speciesGroup.name + " increased by " + nextBiomass);
                        }
                    } else {
                        Debug.Log("Missing Species");
                    }
                }
            }
            */
            }
        }