Skip to content

Commit

Permalink
Merge pull request #39 from space928/TActuWeather
Browse files Browse the repository at this point in the history
 + ActuWeather class and base pointer
  • Loading branch information
space928 authored May 8, 2022
2 parents bf49978 + 6796925 commit 8bfd2e3
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
52 changes: 52 additions & 0 deletions OmsiHook/OmsiActuWeather.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OmsiHook
{
public class OmsiActuWeather : OmsiObject
{
internal OmsiActuWeather(Memory omsiMemory, int baseAddress) : base(omsiMemory, baseAddress) { }
public OmsiActuWeather() : base() { }
/*
public OmsiWebBrowser WebBrowser1
{
get => new(Memory, Memory.ReadMemory<int>(Address + 0x4));
}*/
public bool Active
{
get => Memory.ReadMemory<bool>(Address + 0x8);
set => Memory.WriteMemory(Address + 0x8, value);
}
public string ICAO
{
get => Memory.ReadMemoryString(Address + 0xc);
set => Memory.WriteMemory(Address + 0xc, value);
}
/// <summary>
/// Delphi DateTime - integer part = days since 30/12/1899, fraction part = time of day
/// </summary>
public double LastDownloaded
{
get => Memory.ReadMemory<double>(Address + 0x10);
set => Memory.WriteMemory(Address + 0x10, value);
}
public bool Invalid_ICAO
{
get => Memory.ReadMemory<bool>(Address + 0x18);
set => Memory.WriteMemory(Address + 0x18, value);
}
public uint Counter
{
get => Memory.ReadMemory<uint>(Address + 0x1c);
set => Memory.WriteMemory(Address + 0x1c, value);
}
public byte Prozess
{
get => Memory.ReadMemory<byte>(Address + 0x20);
set => Memory.WriteMemory(Address + 0x20, value);
}
}
}
4 changes: 4 additions & 0 deletions OmsiHook/OmsiHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public class OmsiHook
public OmsiTime Time => new(omsiMemory, 0);
public OmsiDriver[] Drivers => omsiMemory.MarshalStructs<OmsiDriver, OmsiDriverInternal>(omsiMemory.ReadMemoryStructArray<OmsiDriverInternal>(0x008614F8));
public int SelectedDriver => omsiMemory.ReadMemory<int>(0x008614FC);
/// <summary>
/// Current real weather config
/// </summary>
public OmsiActuWeather ActuWeather => new(omsiMemory, omsiMemory.ReadMemory<int>(0x00861278));
public OmsiHumanBeingInst[] Humans => omsiMemory.ReadMemoryObjArray<OmsiHumanBeingInst>(0x0086172c);

/// <summary>
Expand Down

0 comments on commit 8bfd2e3

Please sign in to comment.