Skip to content

ArcaneArts/curse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

import 'package:curse/curse.dart';

void main() {
  CursedInstance c = SomeObject().cursed;
  
  int id = c.getField("id").value;
  c.getField("id").value++; // id is now 1
  
  c.getMethod("setName").invoke(
    positionalArguments: ['New Name']
  );
  
  c.methods.returningVoid().withParameters(
    positionalParameters: [String]
  ).firstOrNull.invoke(
    positionalArguments: ['Another Name']
  );
  
  c.getField("setter").value = 5;
  
  CursedClass cl = SomeObject.cursed;
  SomeObject s2 = cl.constructors.first.invoke();
}

class SomeObject {
  int id = 0;
  
  String getName() => 'SomeObject';
  
  void setName(String name) {
      print('Setting name to $name');
  }
  
  void set setter(int value) {
      id = value;
  }
  
  int get getter => id;
}

Releases

No releases published

Packages

No packages published

Languages