Initial commit

This commit is contained in:
Rendo 2026-08-10 04:00:20 +05:00
commit d327311719
5 changed files with 4030 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

3964
Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

7
Cargo.toml Normal file
View file

@ -0,0 +1,7 @@
[package]
name = "nonagon-infinity"
version = "0.1.0"
edition = "2024"
[dependencies]
iced = "0.14.0"

28
src/main.rs Normal file
View file

@ -0,0 +1,28 @@
mod node;
use iced::{Element, Point};
use node::Node;
#[derive(Default)]
pub struct State {
nodes: Vec<Node>
}
pub enum Message {
MoveNode(usize, Point),
SocketDragStart,
SocketDragEnd,
}
impl State {
pub fn view(&self) -> Element<'_, Message> {
todo!();
}
pub fn update(&mut self, message: Message) {
todo!();
}
}
fn main() -> Result<(), iced::Error> {
iced::run(State::update, State::view)
}

30
src/node.rs Normal file
View file

@ -0,0 +1,30 @@
use iced::{Element, Point};
use crate::Message;
pub struct Node {
pub name: String,
pub inputs: Vec<Socket>,
pub outputs: Vec<Socket>,
pub position: Point,
pub function: Box<dyn Fn([&Socket]) -> Vec<Socket>>
}
pub struct Socket {
name: Option<String>,
kind: SocketType,
data: SocketData
}
pub enum SocketType {
Input,
Output,
}
pub enum SocketData {
F32(f32)
}
pub fn node(from: &Node, node_index: usize) -> Element<'_,Message> {
todo!();
}