public void ParseZone_withYearMonthDayTimeZone()
        {
            var tokens   = Tokens.Tokenize("2:00 US P%sT 1969 Mar 23 14:53:27.856s");
            var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Standard, 3, 23, 0, false, new LocalTime(14, 53, 27, 856)));

            Assert.AreEqual(expected, Parser.ParseZone(string.Empty, tokens));
        }
        public void ParseZone_withDayOfWeek()
        {
            var tokens   = Tokens.Tokenize("2:00 US P%sT 1969 Mar lastSun");
            var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Wall, 3, -1, (int)IsoDayOfWeek.Sunday, false, LocalTime.Midnight));

            Assert.AreEqual(expected, Parser.ParseZone(string.Empty, tokens));
        }
        public void ParseZone_simple()
        {
            var tokens   = Tokens.Tokenize("2:00 US P%sT");
            var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", int.MaxValue, ZoneYearOffset.StartOfYear);

            Assert.AreEqual(expected, Parser.ParseZone(string.Empty, tokens));
        }
        public void ParseZone_withYearMonthDay()
        {
            var tokens   = Tokens.Tokenize("2:00 US P%sT 1969 Mar 23");
            var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Wall, 3, 23, 0, false, LocalTime.Midnight));

            Assert.AreEqual(expected, Parser.ParseZone(string.Empty, tokens));
        }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        //GameObject objectPlayer = GameObject.FindGameObjectWithTag("Player");
        //Player player = objectPlayer.GetComponent<Player>();

        GameObject objectLimit = GameObject.FindGameObjectWithTag("ZoneLimit");
        LimitLine  zoneLimit   = objectLimit.GetComponent <LimitLine>();

        GameObject objectZone = GameObject.FindGameObjectWithTag("Zone");
        ZoneLine   zone       = objectZone.GetComponent <ZoneLine>();

        if (zone != null && update >= 400)
        {
            //player.updateRadius(4f);
            zoneLimit.setZone(Config.SIZE_ZONE * 1.4f);
            zone.setZone(Config.SIZE_ZONE * 1f);
        }

        if (zone != null && update >= 800)
        {
            //player.updateRadius(2f);
            zoneLimit.setZone(Config.SIZE_ZONE * 1f);
            zone.setZone(Config.SIZE_ZONE * 0.5f);
            update = 0;
        }
        update++;
    }
Example #6
0
        public void ParseZone_withYear()
        {
            var parser   = new TzdbZoneInfoParser();
            var tokens   = Tokens.Tokenize("2:00 US P%sT 1969");
            var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Wall, 1, 1, 0, false, LocalTime.Midnight));

            Assert.AreEqual(expected, parser.ParseZone(string.Empty, tokens));
        }
Example #7
0
        public void ParseZone_optionalRule()
        {
            var parser   = new TzdbZoneInfoParser();
            var tokens   = Tokens.Tokenize("2:00 - P%sT");
            var expected = new ZoneLine(string.Empty, ToOffset(2, 0), null, "P%sT", int.MaxValue, ZoneYearOffset.StartOfYear);

            Assert.AreEqual(expected, parser.ParseZone(string.Empty, tokens));
        }
Example #8
0
        public void ParseZone_withYearMonthDayTime()
        {
            var parser   = new TzdbZoneInfoParser();
            var tokens   = Tokens.Tokenize("2:00 US P%sT 1969 Mar 23 14:53:27.856");
            var expected = new ZoneLine("", ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Wall, 3, 23, 0, false, new LocalTime(14, 53, 27, 856)));

            Assert.AreEqual(expected, parser.ParseZone("", tokens));
        }
Example #9
0
        public void ParseZone_simple()
        {
            var parser   = new TzdbZoneInfoParser();
            var tokens   = Tokens.Tokenize("2:00 US P%sT");
            var expected = new ZoneLine("", ToOffset(2, 0), "US", "P%sT", int.MaxValue, TzdbZoneInfoParser.StartOfYearZoneOffset);

            Assert.AreEqual(expected, parser.ParseZone("", tokens));
        }
Example #10
0
 /// <summary>
 /// Adds the given zone line to the database, creating a new list for
 /// that zone ID if necessary.
 /// </summary>
 /// <param name="zone">The zone to add.</param>
 internal void AddZone(ZoneLine zone)
 {
     IList<ZoneLine> zoneSet;
     if (!Zones.TryGetValue(zone.Name, out zoneSet))
     {
         zoneSet = new List<ZoneLine>();
         Zones[zone.Name] = zoneSet;
     }
     zoneSet.Add(zone);
 }
 public void ParseZone_withDayOfWeek()
 {
     var parser = new TzdbZoneInfoParser();
     var tokens = Tokens.Tokenize("2:00 US P%sT 1969 Mar lastSun");
     var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Wall, 3, -1, (int) IsoDayOfWeek.Sunday, false, LocalTime.Midnight));
     Assert.AreEqual(expected, parser.ParseZone(string.Empty, tokens));
 }
 public void ParseZone_withYearMonthDayTimeZone()
 {
     var parser = new TzdbZoneInfoParser();
     var tokens = Tokens.Tokenize("2:00 US P%sT 1969 Mar 23 14:53:27.856s");
     var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Standard, 3, 23, 0, false, new LocalTime(14, 53, 27, 856)));
     Assert.AreEqual(expected, parser.ParseZone(string.Empty, tokens));
 }
 public void ParseZone_withYear()
 {
     var parser = new TzdbZoneInfoParser();
     var tokens = Tokens.Tokenize("2:00 US P%sT 1969");
     var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", 1969, new ZoneYearOffset(TransitionMode.Wall, 1, 1, 0, false, LocalTime.Midnight));
     Assert.AreEqual(expected, parser.ParseZone(string.Empty, tokens));
 }
 public void ParseZone_simple()
 {
     var parser = new TzdbZoneInfoParser();
     var tokens = Tokens.Tokenize("2:00 US P%sT");
     var expected = new ZoneLine(string.Empty, ToOffset(2, 0), "US", "P%sT", int.MaxValue, ZoneYearOffset.StartOfYear);
     Assert.AreEqual(expected, parser.ParseZone(string.Empty, tokens));
 }