View Single Post
Old 05-06-2006, 07:12 PM   #1
Maximus
Variable Bitrate
 
Join Date: Apr 2004
Location: The land of polar bears and nekkid blonds
Posts: 446
C# Linking classes to eachother.

Bit of a noob when it comes to C#.
I'm working on a plugin for Centrafuse and I'd like to have two different classes, "A_Class" beeing the main plugin class and B_Class is my "interface" class that handles the interface to the car.

So, A_Class needs to access instructions in B_Class and vice versa.

The code below shows what I'm thinking about, but unfortunatley it's not that easy.
Code:
class A_Class:CF_Plugin B_Class myB = new B_Class; { public void Do_Something_In_CF() { myB.Do_Something_With_The_Car(); } } class B_Class { A_Class myA = new A_Class; public void Do_Something_With_The_Car() { } public void Control_CF() { myA.CF_Actions(Volume UP); } }

Maximus is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links