Exemplo n.º 1
0
        public void Test_MoonPhaseReference()
        {
            World world = new World(SaveDirectory);

            MoonPhaseReferences moonPhaseReferences = new MoonPhaseReferences(world.DataOvlRef);

            for (byte nDay = 1; nDay <= 28; nDay++)
            {
                for (byte nHour = 0; nHour < 24; nHour++)
                {
                    TimeOfDay tod = new TimeOfDay(world.State.GetDataChunk(GameState.DataChunkName.CURRENT_YEAR),
                                                  world.State.GetDataChunk(GameState.DataChunkName.CURRENT_MONTH),
                                                  world.State.GetDataChunk(GameState.DataChunkName.CURRENT_DAY),
                                                  world.State.GetDataChunk(GameState.DataChunkName.CURRENT_HOUR),
                                                  world.State.GetDataChunk(GameState.DataChunkName.CURRENT_MINUTE));

                    tod.Day  = nDay;
                    tod.Hour = nHour;

                    MoonPhaseReferences.MoonPhases moonPhase = moonPhaseReferences.GetMoonGateMoonPhase(tod);

                    float fMoonAngle = moonPhaseReferences.GetMoonAngle(tod);
                    Assert.True(fMoonAngle >= 0 && fMoonAngle < 360);
                }
            }
        }
Exemplo n.º 2
0
 public Moonstone(MoonPhaseReferences.MoonPhases phase, string longName, string shortName, string findDescription, Moongates moongates, InventoryReference invRef)
     : base(0, longName, shortName, findDescription, MOONSTONE_SPRITE)
 {
     Phase      = phase;
     _moongates = moongates;
     InvRef     = invRef;
 }
Exemplo n.º 3
0
        public void Test_TestCorrectMoons()
        {
            World world = new World(SaveDirectory);

            MoonPhaseReferences moonPhaseReferences = new MoonPhaseReferences(world.DataOvlRef);

            TimeOfDay tod = new TimeOfDay(world.State.GetDataChunk(GameState.DataChunkName.CURRENT_YEAR),
                                          world.State.GetDataChunk(GameState.DataChunkName.CURRENT_MONTH),
                                          world.State.GetDataChunk(GameState.DataChunkName.CURRENT_DAY),
                                          world.State.GetDataChunk(GameState.DataChunkName.CURRENT_HOUR),
                                          world.State.GetDataChunk(GameState.DataChunkName.CURRENT_MINUTE));

            // tod.Day = 2;
            // tod.Hour = 4;
            tod.Day  = 25;
            tod.Hour = 4;

            MoonPhaseReferences.MoonPhases trammelPhase =
                moonPhaseReferences.GetMoonPhasesByTimeOfDay(tod, MoonPhaseReferences.MoonsAndSun.Trammel);
            MoonPhaseReferences.MoonPhases feluccaPhase =
                moonPhaseReferences.GetMoonPhasesByTimeOfDay(tod, MoonPhaseReferences.MoonsAndSun.Felucca);
            Debug.Assert(trammelPhase == MoonPhaseReferences.MoonPhases.GibbousWaning);
            Debug.Assert(feluccaPhase == MoonPhaseReferences.MoonPhases.LastQuarter);
        }