Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ ActuWeather class and base pointer #39

Merged
merged 2 commits into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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