public static void Main () { FriendClass fc = new FriendClass (); // We should be able to access them FriendClass.StaticFriendMethod (); fc.InstanceFriendMethod (); }
static void Main () { FriendClass fc = new FriendClass (); // We should be able to access them int a = FriendClass.StaticFriendProperty; int b = fc.InstanceFriendProperty; }
public static void Main () { FriendClass fc = new FriendClass (); // We should be able to access it FriendClass.StaticFriendField = 5; fc.InstanceFriendField = 6; }
public static void Main() { FriendClass fc = new FriendClass(); // We should be able to access them FriendClass.StaticFriendMethod(); fc.InstanceFriendMethod(); }
static void Main() { FriendClass fc = new FriendClass(); // We should be able to access it FriendClass.StaticFriendField = 5; fc.InstanceFriendField = 6; }
static void Main() { FriendClass fc = new FriendClass(); // We should be able to access them int a = FriendClass.StaticFriendProperty; int b = fc.InstanceFriendProperty; }
void writeFriend(FriendClass f) { string source = "Server=" + serverIP + "; Port=" + port + "; Database=" + database + "; Uid=" + Uid + "; Password="******";"; MySqlConnection _connect = new MySqlConnection(source); _connect.Open(); string _fill = "', '"; string values = "('" + f.getname() + _fill + f.getf1() + _fill + f.getf2() + _fill + f.getf3() + _fill + f.getf4() + _fill + f.getf5() + "')"; string locations = "(Name, FriendOne, FriendTwo, FriendThree, FriendFour, FriendFive)"; string cmdText = "INSERT INTO frienddata " + locations + " VALUES" + values; MySqlCommand _cmd = _connect.CreateCommand(); _cmd.CommandText = cmdText; _cmd.ExecuteNonQuery(); _connect.Close(); }
/* * public bool CheckForEnergizer() * { * foreach (FriendClass friend in friendList) * { * if (friend.GetComponent<FriendClassBunny>() != null) * { * if (friend.GetComponent<FriendClassBunny>().freeWildLifeEnergy) * { * return true; * } * else * { * return false; * } * * } * else * { * return false; * } * } * return false; * } */ public bool CheckForFriend(FriendClass friend) { foreach (FriendClass myFriend in friendList) { if (friend.friendID == myFriend.friendID) { if (friend.ReturnFriendStatus()) { return(true); } else { return(false); } } else { return(false); } } return(false); }
static void Main() { FriendClass.MyMethod(); }
// the friend class would be able to call myMethod public void MyMethod(FriendClass F, double x, int i) { this.MyMethod(x, i); }