vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

BoolexprUtils

AGD · 4975

0 Members and 1 Guest are viewing this topic.

Rating

Average Score - 5 / 5

« Created: November 08, 2016, 08:54:43 AM by moyack »

BoolexprUtils
on: November 08, 2016, 08:04:14 AM
Category: Execution
Language: vJASS, ZINC

Code: jass
  1. library BoolexprUtils
  2.  
  3.     globals
  4.         boolexpr BOOLEXPR_TRUE
  5.         boolexpr BOOLEXPR_FALSE
  6.     endglobals
  7.  
  8.     private module Init
  9.  
  10.         private static method filterTrue takes nothing returns boolean
  11.             return true
  12.         endmethod
  13.  
  14.         private static method filterFalse takes nothing returns boolean
  15.             return false
  16.         endmethod
  17.  
  18.         private static method onInit takes nothing returns nothing
  19.             set BOOLEXPR_TRUE = Filter(function thistype.filterTrue)
  20.             set BOOLEXPR_TRUE = Filter(function thistype.filterFalse)
  21.         endmethod
  22.  
  23.     endmodule
  24.  
  25.     private struct S extends array
  26.         implement Init
  27.     endstruct
  28.  
  29. endlibrary
Code: jass
  1. //! zinc
  2. library BoolexprUtils {
  3.  
  4.     public boolexpr BOOLEXPR_TRUE, BOOLEXPR_FALSE;
  5.  
  6.     module Init {
  7.         static method onInit() {
  8.             BOOLEXPR_TRUE = Filter(function() -> boolean {return true;});
  9.             BOOLEXPR_FALSE = Filter(function() -> boolean {return false;});
  10.         }
  11.     }
  12.  
  13.     struct S extends array {module Init;}
  14.  
  15. }
  16. //! endzinc
« Last Edit: December 19, 2017, 11:37:26 PM by moyack »



Re: BoolexprUtils
Reply #1 on: November 08, 2016, 09:15:32 AM




 

Chaos Realm - The world of Game modders and wc3 addicts     WC3JASS.com - The JASS Vault   Jetcraft - A Starcraft II mod