YojigenShift.YiFramework 7.0.1

dotnet add package YojigenShift.YiFramework --version 7.0.1
                    
NuGet\Install-Package YojigenShift.YiFramework -Version 7.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YojigenShift.YiFramework" Version="7.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="YojigenShift.YiFramework" Version="7.0.1" />
                    
Directory.Packages.props
<PackageReference Include="YojigenShift.YiFramework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add YojigenShift.YiFramework --version 7.0.1
                    
#r "nuget: YojigenShift.YiFramework, 7.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package YojigenShift.YiFramework@7.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=YojigenShift.YiFramework&version=7.0.1
                    
Install as a Cake Addin
#tool nuget:?package=YojigenShift.YiFramework&version=7.0.1
                    
Install as a Cake Tool

YojigenShift.YiFramework ☯️

English | 简体中文

YiFramework is a high-performance C# library designed for Chinese Metaphysics algorithms.

Its goal is to encapsulate complex logic (such as BaZi/Four Pillars, Qi Men Dun Jia, Plum Blossom Oracle, etc.) into pure mathematical models and data structures, providing a robust core driver for game development (Unity/Godot) and Metaphysics applications.

✨ Features

The current version provides the fundamental building blocks for Metaphysics computing:

  • High-Performance GanZhi: O(1) mathematical model for Heavenly Stems and Earthly Branches conversion and indexing, with zero memory allocation.
  • Precision Solar Time Plotting: Built-in simplified VSOP87 astronomy algorithm for accurate Solar Terms and True Solar Time calculation.
  • Qi Men Dun Jia System (Time-Based):
    • Full Layout: Supports Earth, Heaven, Man, and God plates, plus Hidden Stems.
    • Smart Structure Calculation: Uses "Chai Bu" method to determine Yin/Yang Dun and Ju number automatically.
    • Holographic Model: Tracks Zhi Fu (Star) and Zhi Shi (Door) rotations.
    • Pattern Analyzer: Determines Auspicious/Inauspicious combinations (e.g., 10 Stem Combinations / Shi Gan Ke Ying).
  • BaZi Analysis Engine:
    • Complete Ten Gods and Hidden Stems lookup.
    • 12 Life Stages calculation.
    • Strength/Weakness Evaluation and Useful God (Xi Yong Shen) recommendation based on 5-Element energy scoring.
    • Pattern Recognition: Automatically detects Normal Patterns and Special Patterns (Dominant/Surrender structures).
  • Han Style Naming Engine:
    • Chinese Characters Only: The current logic relies on Hanzi shape, meaning, and Kang Xi strokes. English naming is not supported.
    • Shape & Meaning First: Supports primary/secondary elements, structural attributes (Head-Out), and gender preference.
    • Pattern Generation: Auto-generates optimal Wu Xing structures based on "First Useful God" and "Remedy" logic.
    • Zodiac Taboos: Built-in Big/Small zodiac logic and character structure validation.
    • Han Numerology: Lightweight numerology scoring based on Kang Xi stroke units.
  • Six Lines (Liu Yao) System:
    • Coin Casting: Simulates traditional 3-coin method with auto-complete support.
    • Auto Mounting: Automatic Na Jia (Stems/Branches), Shi/Ying assignment, and Six Relations (Liu Qin).
    • ​Metaphysical Analysis: Six Beasts assignment, Void (Kong Wang) calculation, and Day/Month clash analysis.
  • Plum Blossom Oracle (Mei Hua):
    • Casting via Time or Numbers.
    • Deriving Original, Mutual, and Changed Hexagrams.
    • ​Auspiciousness analysis based on Ti/Yong relationship.
  • Yin-Yang & Five Elements: Complete matrix for logic regarding Generating, Overcoming, Weakening, and Draining cycles.
  • Localization (i18n): Built-in localization support for metaphysical terminology (e.g., Stems, Branches, Gods).
  • Zero GC Design: Core algorithms utilize struct and static lookup tables, optimized specifically for high-frequency calls in game loops.

📦 Installation

This project is published on NuGet. You can install it via the Package Manager Console or the .NET CLI:

dotnet add package YojigenShift.YiFramework

For Unity projects, installation via the "NuGet for Unity" plugin is recommended.

🚀 Quick Start

1. Qi Men Dun Jia Plotting & Analysis

using YojigenShift.YiFramework.QiMen.Logic;
using YojigenShift.YiFramework.QiMen.Models;
using YojigenShift.YiFramework.Analysis.Logic;

DateTime time = DateTime.UtcNow;
QiMenChart chart = QiMenPlotter.Plot(time);

// Traverse nine palaces,get patterns
foreach (var palace in chart.Palaces.Values)
{
    var patterns = QiMenPatternAnalyzer.AnalyzePalace(palace);
    foreach (var p in patterns)
    {
        Console.WriteLine($"Palace Index {palace.Index} Found Pattern: {p.Name} - {p.Description}");
    }
}

3. BaZi Plotting & Analysis

using YojigenShift.YiFramework.Analysis.Logic;

// Assume BaziPlotter has already had the four pillars and calculated Five Elements' scores and result
var patternResult = BaZiPatternAnalyzer.Analyze(
    dayMaster, monthBranch, yearStem, monthStem, hourStem, baziAnalysis
);

Console.WriteLine($"Pattern Name: {patternResult.Name}"); // e.g. Cong Sha
Console.WriteLine($"Reason: {patternResult.Description}");

🗺️ Roadmap

YiFramework is under active development. Future updates will follow this roadmap:

  • Phase 1: Foundation
    • GanZhi Math Algorithms
    • Five Elements Matrix
    • Precise Solar Terms Calculation
    • Lunar Calendar Conversion
  • Phase 2: Four Pillars (BaZi)
    • Intelligent Pillar Plotting (Handling Early/Late Rat Hour, Solar Term Boundaries)
    • Ten Gods & Hidden Stems Lookup
    • Basic Strength/Weakness Scoring (For game numerical simulation)
  • Phase 3: Plum Blossom Oracle (Mei Hua Yi Shu)
    • Trigram Definitions & Extensions
    • Hexagram Casting (Time/Number based)
    • Body & Application (Ti/Yong) Relationship Analysis
  • Phase 4: Han Style Naming
    • Character Model (Shape/Meaning First, Multi-Element)
    • Han Numerology (Stroke Unit Digit)
    • Pattern Generation (First Useful God & Remedy Logic)
    • Zodiac Taboos (Big/Small Zodiac & Structure Check)
  • Phase 5: Six Lines (Liu Yao)
    • Coin Casting Simulation
    • Hexagram Mounting (Na Jia / Six Relations)
    • Six Beasts & Void Calculation
    • Status Analysis (Clash/Break)
  • Phase 6: Qi Men Dun Jia
    • Ju Calculation (Chai Bu / Solar Terms)
    • Earth Plate Layout
    • Full Layout (Earth/Heaven/Man/God)
    • Hidden Stems
  • Phase 7: Advanced Analysis
    • Qi Men Patterns (Structures & 10 Stems Combinations)
    • BaZi Advanced Patterns (Dominant & Surrender Patterns)
  • Phase 8: Upcoming Features
    • BaZi Gods & Demons (Shen Sha)
    • Advanced Qi Men Tactics (San Qi De Shi, etc.)
    • Liu Yao Diagnostic Generation

⚙️ Design Philosophy

  • Separation of Algorithm & Presentation: Provides only data and calculation results. No UI code included, making it suitable for Console, Web API, Unity, Godot, etc.
  • Data-Driven: Complex metaphysical dictums and dictionaries are loaded via a separate data layer to avoid hardcoding.
  • Game-Ready: Extreme focus on runtime performance. Core calculation paths avoid Boxing/Unboxing and GC Allocations.

📝 License

Copyright © 2026 Lewis Lin/Yojigen Shift. All rights reserved.

Currently a private repository for internal development.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.1 141 4/20/2026
7.0.0 112 4/20/2026
6.2.5 129 3/5/2026
6.2.4 119 3/4/2026
6.2.3 123 3/2/2026
6.2.2 121 3/1/2026
6.2.1 119 3/1/2026
6.2.0 130 2/28/2026
6.1.0 120 2/25/2026
6.0.0 123 2/22/2026
5.3.2 128 2/21/2026
5.3.1 123 2/20/2026
5.3.0 123 2/18/2026
5.2.2 127 2/12/2026
5.2.1 135 2/12/2026
5.1.1 123 2/12/2026
5.1.0 123 2/9/2026
5.0.0 125 2/8/2026
4.0.0 121 2/6/2026
3.0.0 124 2/5/2026
Loading failed

Fix: Convert the framework to .NET Standard 2.1